News::scopes PHP Method

scopes() public method

public scopes ( ) : array
return array
    public function scopes()
    {
        return ['published' => ['condition' => 't.status = :status', 'params' => [':status' => self::STATUS_PUBLISHED]], 'protected' => ['condition' => 't.is_protected = :is_protected', 'params' => [':is_protected' => self::PROTECTED_YES]], 'public' => ['condition' => 't.is_protected = :is_protected', 'params' => [':is_protected' => self::PROTECTED_NO]], 'recent' => ['order' => 'create_time DESC', 'limit' => 5]];
    }