PcPublishedBehavior
public function behaviors() { $parents_behaviors = parent::behaviors(); $new_behaviors = array( 'publicityScopes' => array( 'class' => 'PcPublishedBehavior', ), ); return array_merge($parents_behaviors, $new_behaviors); }
$posts=Post::model()->published()->findAll();
Determining the status of a model based on model constants is nice but it surely can be more robust:
Be the first person to leave a comment
Please login to leave your comment.