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


PHP Element::bindData方法代码示例

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


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

示例1: fromCSV

 /**
  * Import data from CSV cell
  * @param      $value
  * @param null $position
  * @return Item
  */
 public function fromCSV($value, $position = null)
 {
     $value = $this->_getAutoClean($value);
     if ($this->_element) {
         if ($this->_isRepeatable) {
             // for repeatable objects
             if (strpos($value, JBCSVItem::SEP_ROWS)) {
                 $tmpData = $this->_getArray($value, JBCSVItem::SEP_ROWS);
                 foreach ($tmpData as $val) {
                     if ($val === '') {
                         return $this->_item;
                     }
                     $data[] = array('value' => $val);
                 }
                 $this->_element->bindData($data);
             } else {
                 if ($value === '') {
                     return $this->_item;
                 }
                 $data = $position == 1 ? array() : ($data = $this->_element->data());
                 $data[] = array('value' => JString::trim($value));
                 $this->_element->bindData($data);
             }
         } else {
             if ($value === '') {
                 return $this->_item;
             }
             // for no repeatable objects
             $this->_element->bindData(array('value' => $value));
         }
     }
     return $this->_item;
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:39,代码来源:item.php

示例2: bindData

 public function bindData($data = array())
 {
     parent::bindData($data);
     // add image width/height
     $file = $this->get('file');
     if ($file && ($filepath = $this->app->path->path('root:' . $file))) {
         $size = getimagesize($filepath);
         $this->set('width', $size ? $size[0] : 0);
         $this->set('height', $size ? $size[1] : 0);
     }
 }
开发者ID:ashanrupasinghe,项目名称:slbcv1,代码行数:11,代码来源:image.php

示例3: bindData

 public function bindData($data = array())
 {
     parent::bindData($data);
     // calculate rating/votes
     $query = 'SELECT AVG(value) AS rating, COUNT(id) AS votes' . ' FROM ' . ZOO_TABLE_RATING . ' WHERE element_id = ' . $this->app->database->Quote($this->identifier) . ' AND item_id = ' . $this->_item->id . ' GROUP BY item_id';
     if ($this->_item->id && ($res = $this->app->database->queryAssoc($query))) {
         $this->set('votes', $res['votes']);
         $this->set('value', $res['rating']);
     } else {
         $this->set('votes', 0);
         $this->set('value', 0);
     }
 }
开发者ID:JBZoo,项目名称:Zoo-Changelog,代码行数:13,代码来源:rating.php

示例4: bindData

 /**
  * @param array $data
  */
 public function bindData($data = array())
 {
     $saveData = $data;
     if ($this->getItem()) {
         $newData = JFactory::getSession()->get($this->_getSaveKey(), null, __CLASS__);
     }
     if (!empty($newData)) {
         $saveData = $newData;
     }
     $saveData = array_merge($saveData, $data);
     if ($saveData['is_modified'] == self::MODIFIED_EXEC) {
         parent::bindData($saveData);
         $this->modifyItem();
     } else {
         parent::bindData($saveData);
     }
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:20,代码来源:jbadvert.php

示例5: bindData

 /**
  * Bind data on save
  * Hack for save from admin
  * @param array $data
  */
 public function bindData($data = array())
 {
     $saveData = $data;
     if ($this->getItem()) {
         $newData = JFactory::getSession()->get('items-' . $this->getItem()->id . '-' . $this->identifier, null, __CLASS__);
     }
     if (!empty($newData)) {
         $saveData = $newData;
     }
     // for administator only
     if (isset($data['order_info_admin'])) {
         $orderInfo = array('status' => $data['order_info_status'], 'description' => $data['order_info_description']);
         if (isset($saveData['is_advance'])) {
             $saveData['order_info'] = array_merge($saveData['order_info'], $orderInfo);
         } else {
             reset($saveData);
             $firstKey = key($saveData);
             if (!isset($saveData[$firstKey]['order_info'])) {
                 $saveData[$firstKey]['order_info'] = array();
             }
             $saveData[$firstKey]['order_info'] = array_merge($saveData[$firstKey]['order_info'], $orderInfo);
         }
     }
     parent::bindData($saveData);
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:30,代码来源:jbbasketitems.php

示例6: bindData

 public function bindData($data = array())
 {
     $images_arr = $data['images'];
     if (empty($images_arr)) {
         $images_arr = $data;
     }
     $key = 0;
     if (!empty($images_arr)) {
         foreach ($images_arr as $image) {
             $datanew[$key]['file'] = $this->getUploadedFilePath($image['name']);
             $datanew[$key]['title'] = '';
             $datanew[$key]['link'] = '';
             $datanew[$key]['target'] = '0';
             $datanew[$key]['rel'] = '';
             $key++;
         }
         parent::bindData($datanew);
     }
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:19,代码来源:jbgalleryimage_1.php

示例7: bindData

 public function bindData($data = array())
 {
     parent::bindData($data);
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:4,代码来源:yamap.php

示例8: bindData

 public function bindData($data = array())
 {
     if (!isset($data['hits'])) {
         $this->setData($this->getItem()->elements);
         $data['hits'] = $this->_data->get('hits', 0);
     }
     parent::bindData($data);
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:8,代码来源:download.php

示例9: bindData

 /**
  *  Clean data before bind into element
  * @param array $data
  * @return null | array
  */
 public function bindData($data = array())
 {
     if (isset($data['option'])) {
         foreach ($data['option'] as $key => $value) {
             $data['option'][$key] = $this->_jbcolor->clean($value);
         }
         parent::bindData($data);
     }
     return null;
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:15,代码来源:jbcolor.php


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