public static function getPagination($limit = 10, $identity = null)
    {
        $limit = (int) $limit;
        $count = static::countByIdentity($identity);
        if ($limit > $count) {
            $limit = $count;
        }
        return new Pagination(['totalCount' => $count, 'pageSize' => $limit]);
    }
public static function getPagination($limit = 10, $identity = null)
    {
        $limit = (int) $limit;
        $count = static::countByIdentity($identity);
        if ($limit > $count) {
            $limit = $count;
        }
        return new Pagination(['totalCount' => $count, 'pageSize' => $limit]);
    }
public static function getPagination ( $ limit = 10 , $ identity = null ) { $ limit = ( int ) $ limit ; $ count = static :: countByIdentity ( $ identity ) ; if ( $ limit > $ count ) { $ limit = $ count ; } return new Pagination ( [ 'totalCount' => $ count , 'pageSize' => $ limit ] ) ; }
Get pagination, used for building contents page by page.
@param integer $limit
@param mixed $identity It's type depends on {$this->hostClass}.
@return Pagination
Get pagination used for building contents page by page .