UserToBlog::model PHP Method

model() public static method

Returns the static model of the specified AR class.
public static model ( string $className = __CLASS__ ) : UserToBlog
$className string
return UserToBlog the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

示例#1
0
 public function checkSelf()
 {
     $messages = [];
     // count moderated users
     $membersCnt = UserToBlog::model()->count('status = :status', [':status' => UserToBlog::STATUS_CONFIRMATION]);
     if ($membersCnt) {
         $messages[WebModule::CHECK_NOTICE][] = ['type' => WebModule::CHECK_NOTICE, 'message' => Yii::t('BlogModule.blog', '{count} new members of blog wait for confirmation!', ['{count}' => CHtml::link($membersCnt, ['/blog/userToBlogBackend/index', 'UserToBlog[status]' => UserToBlog::STATUS_CONFIRMATION, 'order' => 'id.desc'])])];
     }
     $postsCount = Post::model()->count('status = :status', [':status' => Post::STATUS_MODERATED]);
     if ($postsCount) {
         $messages[WebModule::CHECK_NOTICE][] = ['type' => WebModule::CHECK_NOTICE, 'message' => Yii::t('BlogModule.blog', '{count} new posts wait for moderation!', ['{count}' => CHtml::link($postsCount, ['/blog/postBackend/index', 'Post[status]' => Post::STATUS_MODERATED, 'order' => 'id.desc'])])];
     }
     return isset($messages[WebModule::CHECK_ERROR]) || isset($messages[WebModule::CHECK_NOTICE]) ? $messages : true;
 }
All Usage Examples Of UserToBlog::model