Logo white

Alexey Boroda / new-acdc

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • new-acdc
  • artweb
  • artbox-catalog
  • models
  • traits
  • BitmaskTrait.php
  • add artbox-catalog to repo
    16f1e516
    mzavalniuk authored
    2021-05-28 16:40:03 +0300  
    Browse Code ยป
BitmaskTrait.php 455 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?php
    
    namespace artbox\catalog\models\traits;
    
    trait BitmaskTrait
    {
        /**
         * @param       $condition
         * @param array $params
         *
         * @return \yii\db\ActiveQuery
         */
        abstract public function andWhere($condition, $params = []);
        
        public function is($attribute, $value)
        {
            return $this->andWhere($attribute . ' & ' . $value . ' != 0');
        }
    }