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


PHP xPDOSimpleObject::toArray方法代码示例

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


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

示例1: toArray

 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     if (!empty($this->xpdo->lexicon) && $this->xpdo->lexicon instanceof modLexicon) {
         if ($this->get('lexicon') != 'core:dashboards') {
             $this->xpdo->lexicon->load($this->get('lexicon'));
         }
         $array['name_trans'] = $this->xpdo->lexicon->exists($this->get('name')) ? $this->xpdo->lexicon($this->get('name')) : $this->get('name');
         $array['description_trans'] = $this->xpdo->lexicon->exists($this->get('description')) ? $this->xpdo->lexicon($this->get('description')) : $this->get('description');
     }
     return $array;
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:12,代码来源:moddashboardwidget.class.php

示例2: toArray

 /**
  * {inheritdoc}
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $arr = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     // figure out the icon
     $icon = $this->getIcon();
     if (!empty($icon) && is_array($icon)) {
         switch ($icon['type']) {
             case 'custom':
                 $arr['iconcls'] = '';
                 $arr['iconpath'] = $icon['value'];
                 break;
             case 'preset':
             default:
                 $arr['iconcls'] = $icon['value'];
                 $arr['iconpath'] = '';
                 break;
         }
     }
     return $arr;
 }
开发者ID:Realetive,项目名称:QuickstartButtons,代码行数:28,代码来源:qsbbutton.class.php

示例3: toArray

 /**
  * Override toArray to provide more values
  *
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $values = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     if ($this->xpdo->context->key != 'mgr' && $this->xpdo->discuss) {
         $values['url'] = $this->getUrl();
     }
     return $values;
 }
开发者ID:oneismore,项目名称:Discuss,代码行数:17,代码来源:disboard.class.php

示例4: toArray

 /**
  * Override toArray to provide more values
  * 
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $values = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     $values[$keyPrefix . 'age'] = $this->get('age');
     $values[$keyPrefix . 'gender_formatted'] = $this->get('gender_formatted');
     $values[$keyPrefix . 'avatarUrl'] = $this->getAvatarUrl();
     $values[$keyPrefix . 'isSelf'] = $this->xpdo->user->get('id') == $this->get('user');
     $values[$keyPrefix . 'canEdit'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'canAccount'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'canMerge'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'name'] = $this->get('name');
     $values[$keyPrefix . 'posts_formatted'] = $this->get('posts_formatted');
     return $values;
 }
开发者ID:oneismore,项目名称:Discuss,代码行数:23,代码来源:disuser.class.php

示例5: toArray

 /**
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     foreach ($array as $k => &$v) {
         if ($k == 'title') {
             $v = strip_tags($v, '<span>');
             $v = preg_replace('@\\[\\[(.[^\\[\\[]*?)\\]\\]@si', '', $v);
             $v = html_entity_decode($v, ENT_COMPAT, 'UTF-8');
         }
     }
     reset($array);
     return $array;
 }
开发者ID:oneismore,项目名称:Discuss,代码行数:20,代码来源:disthread.class.php

示例6: toArray

 /**
  * Always ensure that the title strips any HTML/MODX tags
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     foreach ($array as $k => &$v) {
         if ($k == 'title') {
             $v = $this->xpdo->discuss->stripAllTags($v);
         }
     }
     reset($array);
     return $array;
 }
开发者ID:oneismore,项目名称:Discuss,代码行数:19,代码来源:dispost.class.php

示例7: toArray

 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     $array['badge'] = $this->getBadge();
     return $array;
 }
开发者ID:oneismore,项目名称:Discuss,代码行数:6,代码来源:disusergroupprofile.class.php


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