Пример #1
0
 /**
  * @param Person $person
  *
  * @return bool
  */
 private function saveIfIsRequest(Person $person)
 {
     if (($hours = \Yii::$app->request->post('hours')) && ($cost = \Yii::$app->request->post('cost'))) {
         foreach ($cost as $serviceId => $item) {
             if ($hours[$serviceId] && $cost[$serviceId]) {
                 CommandBusList::getPriceCommandBud()->handle(new SavePersonServiceCommand($person, $serviceId, $hours[$serviceId], $cost[$serviceId]));
             }
         }
         return true;
     }
     return false;
 }