D
D
Dmitry Vasilyuk2014-10-23 16:27:29
PHP
Dmitry Vasilyuk, 2014-10-23 16:27:29

How to call one method from class to class?

Two classes are named. One is called from the other. Generated method from another class. How to make classes so that class methods can be used in other classes.
Example:

class OLI_LU_HOLDSTAT_TC {
      /*
     * Class vyzova zchetchika trans type
     */
    public $tcout = 2;
    function __construct(){
        return $this->tcount;
    }
}

class OLI_LU_HOLDTYPE {
    /*
     * Pri vuzove zavazan na drugoj class
     */
  public $HoldingTypeCode = 'Policy'; // string
  public $tc; // OLI_LU_HOLDTYPE_TC
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Sydorenko, 2014-10-23
@vasilukwolf

Are you talking about this?

class OLI_LU_HOLDSTAT_TC {
      /*
     * Class vyzova zchetchika trans type
     */
    public $tcout = 2;
    function __construct(){
        return $this->tcount;
    }
}

class OLI_LU_HOLDTYPE {
    /*
     * Pri vuzove zavazan na drugoj class
     */
    public $HoldingTypeCode = 'Policy'; // string
    public $tc; // OLI_LU_HOLDTYPE_TC

    function __construct(){
        $tc = new OLI_LU_HOLDSTAT_TC();

        // теперь $tc->tcount будет содержать 2
    }
}

S
signalizator, 2014-10-23
@signalizator

Traits - read.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question