public function getActiveLoyalties()
 {
     if ($this->loyalties === null) {
         $this->loyalties = models\Loyalty::find()->all();
     }
     return $this->loyalties;
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLoyalties()
 {
     return $this->hasMany(Loyalty::className(), ['id' => 'loyaltyId'])->viaTable('product_has_loyalty', ['productId' => 'id']);
 }