protected function countResource(string $resource, array $where = null)
    {
        $model = $this->resources[$resource]['model'];
        $database = $model::getDatabase();
        return $database->count($model::TABLE, $where ?? []);
    }
protected function countResource(string $resource, array $where = null)
    {
        $model = $this->resources[$resource]['model'];
        $database = $model::getDatabase();
        return $database->count($model::TABLE, $where ?? []);
    }
protected function countResource ( string $ resource , array $ where = null ) { $ model = $ this -> resources [ $ resource ] [ 'model' ] ; $ database = $ model :: getDatabase ( ) ; return $ database -> count ( $ model :: TABLE , $ where ?? [ ] ) ; }
Counts rows in Resource's table

@param string  $resource Resource name
@param mixed[] $where    \Medoo\Medoo $where clause

@return integer
Counts rows in Resource s table