Exemplo n.º 1
0
 /**
  * Create a criteria for a specific model
  *
  * @param \Phalcon\DiInterface|null $dependencyInjector
  * @return \Phalcon\Mvc\Model\Criteria
  */
 public static function query($dependencyInjector = null)
 {
     if (is_object($dependencyInjector) === false || $dependencyInjector instanceof DiInterface === false) {
         $dependencyInjector = DI::getDefault();
     }
     $criteria = new Criteria();
     $criteria->setDi($dependencyInjector);
     $criteria->setModelName(get_called_class());
     return $criteria;
 }