__callStatic() public static method

Retrieves post with id 23 using the 'first' finder. Posts::first(array('conditions' => array('id' => 23))); Posts::findById(23); Posts::findById(23); All posts that have a trueish is_published field. Posts::all(array('conditions' => array('is_published' => true))); Posts::findAll(array('conditions' => array('is_published' => true))); Posts::findAllByIsPublshed(true) Counts all posts. Posts::count()
See also: lithium\data\Model::find()
See also: lithium\data\Model::$_meta
public static __callStatic ( string $method, array $params ) : mixed
$method string Method name caught by `__callStatic()`.
$params array Arguments given to the above `$method` call.
return mixed Results of dispatched `Model::find()` call.
コード例 #1
0
 /**
  * Catches all context method calls and, if it's proper to call,
  * starts the API request process. Otherwise invokes the method.
  *
  * @access public
  * @param string $method
  * @param array $params
  * @return mixed
  */
 public static function __callStatic($method, $params)
 {
     switch ($method) {
         case 'authenticate':
         case 'ping':
         case 'send':
         case 'query':
         case 'startbatch':
         case 'senditem':
         case 'quicksend':
         case 'endbatch':
         case 'send_bulk':
             $self = static::_object();
             $conn = $self::connection();
             return $conn->invokeMethod($method, $params);
             // forward
             break;
     }
     return parent::__callStatic($method, $params);
     // ignore
 }