/** * Доступные платежные системы * * @return ShopPaySystem[] */ public function getPaySystems() { return $this->personType->getPaySystems()->andWhere([ShopPaySystem::tableName() . ".active" => Cms::BOOL_Y]); }
/** * Доступные платежные системы * * @return ShopPaySystem[] */ public function getPaySystems() { if (!$this->personType) { $query = ShopPaySystem::find()->andWhere([ShopPaySystem::tableName() . ".active" => Cms::BOOL_Y]); $query->multiple = true; return $query; } return $this->personType->getPaySystems()->andWhere([ShopPaySystem::tableName() . ".active" => Cms::BOOL_Y]); }