public static function findPostsCount($id)
    {
        $cache = Podium::getInstance()->podiumCache->getElement('user.postscount', $id);
        if ($cache === false) {
            $cache = (new Query)->from(Post::tableName())->where(['author_id' => $id])->count();
            Podium::getInstance()->podiumCache->setElement('user.postscount', $id, $cache);
        }
        return $cache;
    }
public static function findPostsCount($id)
    {
        $cache = Podium::getInstance()->podiumCache->getElement('user.postscount', $id);
        if ($cache === false) {
            $cache = (new Query)->from(Post::tableName())->where(['author_id' => $id])->count();
            Podium::getInstance()->podiumCache->setElement('user.postscount', $id, $cache);
        }
        return $cache;
    }
public static function findPostsCount ( $ id ) { $ cache = Podium :: getInstance ( ) -> podiumCache -> getElement ( 'user.postscount' , $ id ) ; if ( $ cache === false ) { $ cache = ( new Query ) -> from ( Post :: tableName ( ) ) -> where ( [ 'author_id' => $ id ] ) -> count ( ) ; Podium :: getInstance ( ) -> podiumCache -> setElement ( 'user.postscount' , $ id , $ cache ) ; } return $ cache ; }
Returns number of active posts added by user of given ID.
@param int $id
@return int
Returns number of active posts added by user of given ID .