Example #1
0
File: Model.php Project: atk4/atk4
 /**
  * Count records of model.
  *
  * @param string $alias Optional alias of count result
  *
  * @return int
  */
 public function count($alias = null)
 {
     if ($this->controller && $this->controller->hasMethod('count')) {
         return $this->controller->count($this, $alias);
     }
     throw $this->exception('The controller doesn\'t support count', 'NotImplemented')->addMoreInfo('controller', $this->controller ? $this->controller->short_name : 'none');
 }