Ejemplo n.º 1
0
 protected function saveStatus(EntityInterface $entity)
 {
     if (!$entity->getStatusId() || !$entity->getStatusDate()) {
         return;
     }
     $rel = new Table\BrandsStatusesRel();
     $row = $rel->fetchRow(array('brandId = ?' => $entity->getId(), 'statusId = ?' => $entity->getStatusId(), 'date = ?' => $entity->getStatusDate()));
     try {
         if ($row === \null) {
             $row = $rel->createRow(array('brandId' => $entity->getId(), 'statusId' => $entity->getStatusId(), 'date' => $entity->getStatusDate()));
         }
         $row->note = $entity->getStatusNote();
         $row->save();
     } catch (\Exception $e) {
     }
 }