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


PHP Entry::getData方法代码示例

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


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

示例1: getEntryValue

 public function getEntryValue(Entry $entry)
 {
     if (!$this->initialize()) {
         return '';
     }
     $section = $this->getSection($entry->get('section_id'));
     $field = @array_shift($section->fetchVisibleColumns());
     $span = new XMLElement('span');
     if (is_null($field)) {
         return '';
     }
     $data = $entry->getData($field->get('id'));
     if (empty($data)) {
         return '';
     }
     $data = $field->prepareTableValue($data, $span);
     if ($data instanceof XMLElement) {
         $data = $data->generate();
     }
     return strip_tags($data);
 }
开发者ID:psychoticmeowArchives,项目名称:audittrail,代码行数:21,代码来源:extension.driver.php

示例2: edit

 /**
  * Update an existing Entry object given an Entry object
  *
  * @param Entry $entry
  *  An Entry object
  * @return boolean
  */
 public function edit(Entry $entry)
 {
     foreach ($entry->getData() as $field_id => $field) {
         if (empty($field_id)) {
             continue;
         }
         try {
             Symphony::Database()->delete('tbl_entries_data_' . $field_id, " `entry_id` = '" . $entry->get('id') . "'");
         } catch (Exception $e) {
             // Discard?
         }
         if (!is_array($field) || empty($field)) {
             continue;
         }
         $data = array('entry_id' => $entry->get('id'));
         $fields = array();
         foreach ($field as $key => $value) {
             if (is_array($value)) {
                 foreach ($value as $ii => $v) {
                     $fields[$ii][$key] = $v;
                 }
             } else {
                 $fields[max(0, count($fields) - 1)][$key] = $value;
             }
         }
         foreach ($fields as $index => $field_data) {
             $fields[$index] = array_merge($data, $field_data);
         }
         Symphony::Database()->insert($fields, 'tbl_entries_data_' . $field_id);
     }
     return true;
 }
开发者ID:scottkf,项目名称:keepflippin--on-symphony,代码行数:39,代码来源:class.entrymanager.php

示例3: processEntry

 /**
  * Given an Entry object, this function will generate an XML representation
  * of the Entry to be returned. It will also add any parameters selected
  * by this datasource to the parameter pool.
  *
  * @param Entry $entry
  * @return XMLElement|boolean
  *  Returns boolean when only parameters are to be returned.
  */
 public function processEntry(Entry $entry)
 {
     $data = $entry->getData();
     $xEntry = new XMLElement('entry');
     $xEntry->setAttribute('id', $entry->get('id'));
     if (!empty($this->_associated_sections)) {
         $this->setAssociatedEntryCounts($xEntry, $entry);
     }
     if ($this->_can_process_system_parameters) {
         $this->processSystemParameters($entry);
     }
     foreach ($data as $field_id => $values) {
         if (!isset(self::$_fieldPool[$field_id]) || !is_object(self::$_fieldPool[$field_id])) {
             self::$_fieldPool[$field_id] =& FieldManager::fetch($field_id);
         }
         $this->processOutputParameters($entry, $field_id, $values);
         if (!$this->_param_output_only) {
             foreach ($this->dsParamINCLUDEDELEMENTS as $handle) {
                 list($handle, $mode) = preg_split('/\\s*:\\s*/', $handle, 2);
                 if (self::$_fieldPool[$field_id]->get('element_name') == $handle) {
                     self::$_fieldPool[$field_id]->appendFormattedElement($xEntry, $values, $this->dsParamHTMLENCODE ? true : false, $mode, $entry->get('id'));
                 }
             }
         }
     }
     if ($this->_param_output_only) {
         return true;
     }
     if (in_array('system:date', $this->dsParamINCLUDEDELEMENTS)) {
         $xEntry->appendChild(General::createXMLDateObject(DateTimeObj::get('U', $entry->creationDate), 'system-date'));
     }
     return $xEntry;
 }
开发者ID:nickdunn,项目名称:elasticsearch-surfin-shakespeare,代码行数:42,代码来源:class.datasource.section.php

示例4: __wrapFieldWithDiv

 /**
  * Given a Field and Entry object, this function will wrap
  * the Field's displayPublishPanel result with a div that
  * contains some contextual information such as the Field ID,
  * the Field handle and whether it is required or not.
  *
  * @param Field $field
  * @param Entry $entry
  * @return XMLElement
  */
 private function __wrapFieldWithDiv(Field $field, Entry $entry)
 {
     $div = new XMLElement('div', NULL, array('id' => 'field-' . $field->get('id'), 'class' => 'field field-' . $field->handle() . ($field->get('required') == 'yes' ? ' required' : '')));
     $field->displayPublishPanel($div, $entry->getData($field->get('id')), isset($this->_errors[$field->get('id')]) ? $this->_errors[$field->get('id')] : NULL, null, null, is_numeric($entry->get('id')) ? $entry->get('id') : NULL);
     return $div;
 }
开发者ID:nickdunn,项目名称:elasticsearch-surfin-shakespeare,代码行数:16,代码来源:content.publish.php

示例5: prepareAssociationsDrawerXMLElement

 /**
  * Format this field value for display in the Associations Drawer publish index.
  * By default, Symphony will use the return value of the `prepareReadableValue` function.
  *
  * @since Symphony 2.4
  * @since Symphony 2.5.0 The prepopulate parameter was added.
  *
  * @param Entry $e
  *   The associated entry
  * @param array $parent_association
  *   An array containing information about the association
  * @param string $prepopulate
  *   A string containing prepopulate parameter to append to the association url
  *
  * @return XMLElement
  *   The XMLElement must be a li node, since it will be added an ul node.
  */
 public function prepareAssociationsDrawerXMLElement(Entry $e, array $parent_association, $prepopulate = '')
 {
     $value = $this->prepareReadableValue($e->getData($this->get('id')), $e->get('id'));
     // fallback for compatibility since the default
     // `preparePlainTextValue` is not compatible with all fields
     // this should be removed in Symphony 3.0
     if (empty($value)) {
         $value = strip_tags($this->prepareTableValue($e->getData($this->get('id')), null, $e->get('id')));
     }
     // use our factory method to create the html
     $li = self::createAssociationsDrawerXMLElement($value, $e, $parent_association, $prepopulate);
     $li->setAttribute('class', 'field-' . $this->get('type'));
     return $li;
 }
开发者ID:roshinebagha,项目名称:Symphony-Test,代码行数:31,代码来源:class.field.php

示例6: prepareAssociationsDrawerXMLElement

 public function prepareAssociationsDrawerXMLElement(Entry $e, array $parent_association, $prepolutate = '')
 {
     $currentSection = SectionManager::fetch($parent_association['child_section_id']);
     $visibleCols = $currentSection->fetchVisibleColumns();
     $outputFieldId = current(array_keys($visibleCols));
     $outputField = FieldManager::fetch($outputFieldId);
     $value = $outputField->prepareReadableValue($e->getData($outputFieldId), $e->get('id'), true, __('None'));
     $li = new XMLElement('li');
     $li->setAttribute('class', 'field-' . $this->get('type'));
     $a = new XMLElement('a', strip_tags($value));
     $a->setAttribute('href', SYMPHONY_URL . '/publish/' . $parent_association['handle'] . '/edit/' . $e->get('id') . '/');
     $li->appendChild($a);
     return $li;
 }
开发者ID:hotdoy,项目名称:EDclock,代码行数:14,代码来源:field.entry_relationship.php

示例7: prepareAssociationsDrawerXMLElement

 /**
  * Format this field value for display in the Associations Drawer publish index.
  * By default, Symphony will use the return value of the `prepareTableValue` function.
  * 
  * @param Entry $e
  *   The associated entry
  * @param array $parent_association
  *   An array containing information about the parent
  *
  * return XMLElement
  *   The XMLElement must be a li node, since it will be added an ul node.
  */
 public function prepareAssociationsDrawerXMLElement(Entry $e, array $parent_association)
 {
     $value = $this->prepareTableValue($e->getData($this->get('id')), null, $e->get('id'));
     $li = new XMLElement('li');
     $li->setAttribute('class', 'field-' . $this->get('type'));
     $a = new XMLElement('a', strip_tags($value));
     $a->setAttribute('href', SYMPHONY_URL . '/publish/' . $parent_association['handle'] . '/edit/' . $e->get('id') . '/');
     $li->appendChild($a);
     return $li;
 }
开发者ID:davjand,项目名称:codecept-symphonycms-db,代码行数:22,代码来源:class.field.php

示例8: __wrapFieldWithDiv

 /**
  * Given a Field and Entry object, this function will wrap
  * the Field's displayPublishPanel result with a div that
  * contains some contextual information such as the Field ID,
  * the Field handle and whether it is required or not.
  *
  * @param Field $field
  * @param Entry $entry
  * @return XMLElement
  */
 private function __wrapFieldWithDiv(Field $field, Entry $entry)
 {
     $is_hidden = $this->isFieldHidden($field);
     $div = new XMLElement('div', null, array('id' => 'field-' . $field->get('id'), 'class' => 'field field-' . $field->handle() . ($field->get('required') == 'yes' ? ' required' : '') . ($is_hidden === true ? ' irrelevant' : '')));
     $field->setAssociationContext($div);
     $field->displayPublishPanel($div, $entry->getData($field->get('id')), isset($this->_errors[$field->get('id')]) ? $this->_errors[$field->get('id')] : null, null, null, is_numeric($entry->get('id')) ? $entry->get('id') : null);
     /**
      * Allows developers modify the field before it is rendered in the publish
      * form. Passes the `Field` object, `Entry` object, the `XMLElement` div and
      * any errors for the entire `Entry`. Only the `$div` element
      * will be altered before appending to the page, the rest are read only.
      *
      * @since Symphony 2.5.0
      * @delegate ModifyFieldPublishWidget
      * @param string $context
      * '/backend/'
      * @param Field $field
      * @param Entry $entry
      * @param array $errors
      * @param Widget $widget
      */
     Symphony::ExtensionManager()->notifyMembers('ModifyFieldPublishWidget', '/backend/', array('field' => $field, 'entry' => $entry, 'errors' => $this->_errors, 'widget' => &$div));
     return $div;
 }
开发者ID:rc1,项目名称:WebAppsWithCmsStartHere,代码行数:34,代码来源:content.publish.php

示例9: edit

 /**
  * Update an existing Entry object given an Entry object
  *
  * @param Entry $entry
  *  An Entry object
  * @throws DatabaseException
  * @return boolean
  */
 public static function edit(Entry $entry)
 {
     // Update modification date.
     Symphony::Database()->update(array('modification_date' => $entry->get('modification_date'), 'modification_date_gmt' => $entry->get('modification_date_gmt')), 'tbl_entries', sprintf(' `id` = %d', $entry->get('id')));
     // Iterate over all data for this entry, deleting existing data first
     // then inserting a new row for the data
     foreach ($entry->getData() as $field_id => $field) {
         if (empty($field_id)) {
             continue;
         }
         try {
             Symphony::Database()->delete('tbl_entries_data_' . $field_id, sprintf("\n                    `entry_id` = %d", $entry->get('id')));
         } catch (Exception $e) {
             // Discard?
         }
         if (!is_array($field) || empty($field)) {
             continue;
         }
         $data = array('entry_id' => $entry->get('id'));
         $fields = array();
         foreach ($field as $key => $value) {
             if (is_array($value)) {
                 foreach ($value as $ii => $v) {
                     $fields[$ii][$key] = $v;
                 }
             } else {
                 $fields[max(0, count($fields) - 1)][$key] = $value;
             }
         }
         foreach ($fields as $index => $field_data) {
             $fields[$index] = array_merge($data, $field_data);
         }
         Symphony::Database()->insert($fields, 'tbl_entries_data_' . $field_id);
     }
     return true;
 }
开发者ID:jurajkapsz,项目名称:symphony-2,代码行数:44,代码来源:class.entrymanager.php

示例10: __replaceFieldsInString

 private function __replaceFieldsInString($string, Entry $entry)
 {
     $fields = $this->__findFieldsInString($string, true);
     if (is_array($fields) && !empty($fields)) {
         $FieldManager = new FieldManager($this->_Parent);
         foreach ($fields as $element_name => $field_id) {
             if ($field_id == NULL) {
                 continue;
             }
             $field_data = $entry->getData($field_id);
             $fieldObj = $FieldManager->fetch($field_id);
             $value = $fieldObj->prepareTableValue($field_data);
             $string = str_replace('{$' . $element_name . '}', $value, $string);
             $string = str_replace('{$' . $element_name . '::handle}', Lang::createHandle($value), $string);
         }
     }
     return $string;
 }
开发者ID:ErisDS,项目名称:Bugaroo,代码行数:18,代码来源:extension.driver.php

示例11: equals

 public function equals(Entry $e) : bool
 {
     return $this->criteria['data'] == $e->getData();
 }
开发者ID:xdrm-brackets,项目名称:intothewhile,代码行数:4,代码来源:Entry.class.php


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