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');
    }
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');
    }
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' ) ; }
Count records of model.

@param string $alias Optional alias of count result

@return int
Count records of model .