Prado\Data\ActiveRecord\TActiveRecord::finder PHP 메소드

finder() 공개 정적인 메소드

The finder objects are static instances for each ActiveRecord class. This means that event handlers bound to these finder instances are class wide. Create a new instance of the ActiveRecord class if you wish to bound the event handlers to object instance.
public static finder ( $className = __CLASS__ ) : TActiveRecord
리턴 TActiveRecord active record finder instance.
    public static function finder($className = __CLASS__)
    {
        static $finders = array();
        if (!isset($finders[$className])) {
            $f = Prado::createComponent($className);
            $finders[$className] = $f;
        }
        return $finders[$className];
    }

Usage Example

예제 #1
0
 /**
  * @return TActiveRecord Active Record finder instance
  */
 protected function getRecordFinder()
 {
     return TActiveRecord::finder($this->getRecordClass());
 }
All Usage Examples Of Prado\Data\ActiveRecord\TActiveRecord::finder