示例#1
0
 public function deleteAction($entityId)
 {
     $query = CustomerQuery::create()->joinOrder()->filterById($entityId)->findOne();
     if (null !== $query) {
         throw new HttpException(403, json_encode(["error" => sprintf("You can't delete the customer %d as he has orders", $entityId)]));
     }
     return parent::deleteAction($entityId);
 }