コード例 #1
0
 public function actionRemoveTag()
 {
     $result = ['status' => 'ok'];
     $params = $this->getParams();
     $accountId = $this->getAccountId();
     if (empty($params['tagName'])) {
         throw new BadRequestHttpException("Tag name can not be empty");
     }
     if (empty($params['helpdeskIds'])) {
         throw new BadRequestHttpException("Helpdesk id can not be empty");
     }
     $tagName = $params['tagName'];
     $helpdeskIds = $params['helpdeskIds'];
     if (!empty($helpdeskIds)) {
         $helpdeskMongoIds = [];
         foreach ($helpdeskIds as $helpdeskId) {
             $helpdeskMongoIds[] = new \MongoId($helpdeskId);
         }
         HelpDesk::removeTag($tagName, $helpdeskMongoIds);
     }
     return $result;
 }