Prado\Data\ActiveRecord\TActiveRecord::finder PHP Méthode

finder() public static méthode

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
Résultat 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

Exemple #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