當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormModel::deleteEntity方法代碼示例

本文整理匯總了PHP中Mautic\CoreBundle\Model\FormModel::deleteEntity方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormModel::deleteEntity方法的具體用法?PHP FormModel::deleteEntity怎麽用?PHP FormModel::deleteEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mautic\CoreBundle\Model\FormModel的用法示例。


在下文中一共展示了FormModel::deleteEntity方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: deleteEntity

 /**
  * Delete an entity
  *
  * @param object $entity
  *
  * @return void
  */
 public function deleteEntity($entity)
 {
     $this->getRepository()->nullVariantParent($entity->getId());
     return parent::deleteEntity($entity);
 }
開發者ID:smotalima,項目名稱:mautic,代碼行數:12,代碼來源:EmailModel.php

示例2: deleteEntity

 /**
  * {@inheritdoc}
  *
  * @param  $entity
  */
 public function deleteEntity($entity)
 {
     parent::deleteEntity($entity);
     //remove the column from the leads table
     $leadsSchema = $this->factory->getSchemaHelper('column', 'leads');
     $leadsSchema->dropColumn($entity->getAlias());
     $leadsSchema->executeChanges();
 }
開發者ID:woakes070048,項目名稱:mautic,代碼行數:13,代碼來源:FieldModel.php

示例3: deleteEntity

 /**
  * @param Email $entity
  */
 public function deleteEntity($entity)
 {
     if ($entity->isVariant() && $entity->getIsPublished()) {
         $this->resetVariants($entity);
     }
     parent::deleteEntity($entity);
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:10,代碼來源:EmailModel.php

示例4: deleteEntity

 /**
  * {@inheritdoc}
  */
 public function deleteEntity($entity)
 {
     parent::deleteEntity($entity);
     if (!$entity->getId()) {
         //delete the associated results table
         $schemaHelper = $this->factory->getSchemaHelper('table');
         $schemaHelper->deleteTable("form_results_" . $entity->deletedId . "_" . $entity->getAlias());
         $schemaHelper->executeChanges();
     }
 }
開發者ID:smotalima,項目名稱:mautic,代碼行數:13,代碼來源:FormModel.php

示例5: deleteEntity

 /**
  * {@inheritdoc}
  *
  * @param  $entity
  */
 public function deleteEntity($entity)
 {
     parent::deleteEntity($entity);
     $objects = ['lead' => 'leads', 'company' => 'companies'];
     $object = $objects[$entity->getObject()];
     //remove the column from the leads table
     $leadsSchema = $this->schemaHelperFactory->getSchemaHelper('column', $object);
     $leadsSchema->dropColumn($entity->getAlias());
     $leadsSchema->executeChanges();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:15,代碼來源:FieldModel.php

示例6: deleteEntity

 /**
  * @param object $entity
  */
 public function deleteEntity($entity)
 {
     // Delete custom avatar if one exists
     $imageDir = $this->factory->getSystemPath('images', true);
     $avatar = $imageDir . '/lead_avatars/avatar' . $entity->getId();
     if (file_exists($avatar)) {
         unlink($avatar);
     }
     parent::deleteEntity($entity);
 }
開發者ID:HomeRefill,項目名稱:mautic,代碼行數:13,代碼來源:LeadModel.php

示例7: deleteEntity

 /**
  * {@inheritdoc}
  *
  * @throws PreconditionRequiredHttpException
  */
 public function deleteEntity($entity)
 {
     if (!$entity instanceof Role) {
         throw new MethodNotAllowedHttpException(['Role'], 'Entity must be of class Role()');
     }
     $users = $this->em->getRepository('MauticUserBundle:User')->findByRole($entity);
     if (count($users)) {
         throw new PreconditionRequiredHttpException($this->translator->trans('mautic.user.role.error.deletenotallowed', ['%name%' => $entity->getName()], 'flashes'));
     }
     parent::deleteEntity($entity);
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:16,代碼來源:RoleModel.php

示例8: deleteEntity

 /**
  * Delete an entity
  *
  * @param  $entity
  * @return null|object
  */
 public function deleteEntity($entity)
 {
     $bundle = $entity->getBundle();
     //if it doesn't have a dot, then assume the model will be $bundle.$bundle
     $modelName = strpos($bundle, '.') === false ? $bundle . '.' . $bundle : $bundle;
     $model = $this->factory->getModel($modelName);
     $repo = $model->getRepository();
     $tableAlias = $repo->getTableAlias();
     $entities = $model->getEntities(array('filter' => array('force' => array(array('column' => $tableAlias . '.category', 'expr' => 'eq', 'value' => $entity->getId())))));
     if (!empty($entities)) {
         foreach ($entities as $e) {
             $e->setCategory(null);
         }
         $model->saveEntities($entities, false);
     }
     parent::deleteEntity($entity);
 }
開發者ID:woakes070048,項目名稱:mautic,代碼行數:23,代碼來源:CategoryModel.php

示例9: deleteEntity

 /**
  * @param object $entity
  */
 public function deleteEntity($entity)
 {
     // Null all the event parents for this campaign to avoid database constraints
     $this->getEventRepository()->nullEventParents($entity->getId());
     parent::deleteEntity($entity);
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:9,代碼來源:CampaignModel.php


注:本文中的Mautic\CoreBundle\Model\FormModel::deleteEntity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。