当前位置: 首页>>代码示例>>PHP>>正文


PHP Field::entryDataCleanup方法代码示例

本文整理汇总了PHP中Field::entryDataCleanup方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::entryDataCleanup方法的具体用法?PHP Field::entryDataCleanup怎么用?PHP Field::entryDataCleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Field的用法示例。


在下文中一共展示了Field::entryDataCleanup方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: entryDataCleanup

 public function entryDataCleanup($entry_id, $data = null)
 {
     $entryManager = new EntryManager(Symphony::Engine());
     $field_id = $this->get('linked_field_id');
     $entry_ids = Symphony::Database()->fetchCol('linked_entry_id', sprintf("\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tf.linked_entry_id\n\t\t\t\t\tFROM\n\t\t\t\t\t\t`tbl_entries_data_%s` AS f\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tf.entry_id = '%s'\n\t\t\t\t", $this->get('id'), $entry_id));
     $entries = $entryManager->fetch($entry_ids, $this->get('linked_section_id'));
     if ($entries) {
         foreach ($entries as $entry) {
             if (!is_object($entry)) {
                 continue;
             }
             $values = $entry->getData($field_id);
             if (is_array($values) and array_key_exists('linked_entry_id', $values)) {
                 $values = $values['linked_entry_id'];
             }
             if (is_null($values)) {
                 $values = array();
             } else {
                 if (!is_array($values)) {
                     $values = array($values);
                 }
             }
             $values = array_diff($values, array($entry_id));
             if (empty($values)) {
                 $values = null;
             }
             $entry->setData($field_id, array('linked_entry_id' => $values));
             $entry->commit();
         }
     }
     return parent::entryDataCleanup($entry_id, $data);
 }
开发者ID:symphonists,项目名称:bilinkfield,代码行数:32,代码来源:field.bilink.php

示例2: entryDataCleanup

 public function entryDataCleanup($entry_id, $data = null)
 {
     $entryManager = new EntryManager($this->_engine);
     $field_id = $this->get('id');
     $entries = $this->_engine->Database->fetchCol('linked_entry_id', sprintf("\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tf.linked_entry_id\n\t\t\t\t\tFROM\n\t\t\t\t\t\t`tbl_entries_data_{$field_id}` AS f\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tf.entry_id = '{$entry_id}'\n\t\t\t\t"));
     foreach ($entries as $linked_entry_id) {
         if (is_null($linked_entry_id)) {
             continue;
         }
         $entry = @current($entryManager->fetch($linked_entry_id, $this->get('linked_section_id')));
         if (!is_object($entry)) {
             continue;
         }
         $values = $entry->getData($this->get('linked_field_id'));
         if (array_key_exists(linked_entry_id, $values)) {
             $values = $values['linked_entry_id'];
         }
         if (is_null($values)) {
             $values = array();
         } else {
             if (!is_array($values)) {
                 $values = array($values);
             }
         }
         $values = array_diff($values, array($entry_id));
         $entry->setData($this->get('linked_field_id'), array('linked_entry_id' => $values));
         $entry->commit();
     }
     return parent::entryDataCleanup($entry_id, $data);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:30,代码来源:field.bilink.php

示例3: entryDataCleanup

 public function entryDataCleanup($entry_id, $data)
 {
     $file_location = WORKSPACE . '/' . ltrim($data['file'], '/');
     if (is_file($file_location)) {
         General::deleteFile($file_location);
     }
     parent::entryDataCleanup($entry_id);
     return true;
 }
开发者ID:benesch,项目名称:hilton-unar,代码行数:9,代码来源:field.upload.php

示例4: entryDataCleanup

 public function entryDataCleanup($entry_id, $data = null)
 {
     $file_location = $this->getFilePath($data['file']);
     if (is_file($file_location)) {
         General::deleteFile($file_location);
     }
     parent::entryDataCleanup($entry_id);
     return true;
 }
开发者ID:valery,项目名称:symphony-2,代码行数:9,代码来源:field.upload.php

示例5: entryDataCleanup

 public function entryDataCleanup($entry_id, $data = NULL)
 {
     if (is_array($data)) {
         foreach ($data as $file) {
             $file = $this->getFilePath($file);
             if (is_file($file)) {
                 General::deleteFile($file);
             }
         }
     }
     return Field::entryDataCleanup($entry_id);
 }
开发者ID:justinjaywang,项目名称:multiuploadfield,代码行数:12,代码来源:field.multiupload.php

示例6: entryDataCleanup

 public function entryDataCleanup($entry_id, $data)
 {
     if ($this->get('remove_from_bucket') == true) {
         try {
             if (!is_null($data['file'])) {
                 $this->s3->deleteObject($this->get('bucket'), basename($data['file']));
             }
         } catch (Exception $e) {
         }
     }
     Field::entryDataCleanup($entry_id);
     return true;
 }
开发者ID:TheJester12,项目名称:s3upload_field,代码行数:13,代码来源:field.s3upload.php

示例7: entryDataCleanup

 public function entryDataCleanup($entry_id, $data = NULL)
 {
     try {
         $newsletter_id = EmailNewsletterManager::delete($data['newsletter_id']);
         return parent::entryDataCleanup($entry_id, $data);
     } catch (Exception $e) {
         return false;
     }
 }
开发者ID:jonmifsud,项目名称:email_newsletter_manager,代码行数:9,代码来源:field.email_newsletter_manager.php

示例8: entryDataCleanup

 /**
  *
  * Remove the entry data of this field from the database, when deleting an entry
  * @param integer|array $entry_id
  * @param array $data
  * @return boolean
  */
 public function entryDataCleanup($entry_id, array $data)
 {
     if (empty($entry_id) || !parent::entryDataCleanup($entry_id, $data)) {
         return false;
     }
     return true;
 }
开发者ID:justinjaywang,项目名称:oembed_field,代码行数:14,代码来源:field.oembed.php


注:本文中的Field::entryDataCleanup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。