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


PHP eZPersistentObject::attribute方法代码示例

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


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

示例1: attribute

 function attribute($attr, $noFunction = false)
 {
     $eventType = $this->eventType();
     if (is_object($eventType) and in_array($attr, $eventType->typeFunctionalAttributes())) {
         return $eventType->attributeDecoder($this, $attr);
     }
     return eZPersistentObject::attribute($attr);
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:8,代码来源:ezworkflowevent.php

示例2: attribute

 /**
  * (non-PHPdoc)
  * @see kernel/classes/eZPersistentObject#attribute($attr, $noFunction)
  */
 function attribute($attr, $noFunction = false)
 {
     switch ($attr) {
         case 'list_attribute_content':
             return $this->getListAttributeContent();
             break;
         default:
             return eZPersistentObject::attribute($attr);
     }
 }
开发者ID:hudri,项目名称:cjw_newsletter,代码行数:14,代码来源:cjwnewsletteredition.php

示例3: attribute

 /**
  * (non-PHPdoc)
  * @see kernel/classes/eZPersistentObject#attribute($attr, $noFunction)
  */
 function attribute($attr, $noFunction = false)
 {
     switch ($attr) {
         case 'to_string':
             return $this->toString();
             break;
         default:
             return eZPersistentObject::attribute($attr);
     }
 }
开发者ID:hudri,项目名称:cjw_newsletter,代码行数:14,代码来源:cjwnewsletterlist.php

示例4: attribute

 function attribute($attr, $noFunction = false)
 {
     $retVal = null;
     switch ($attr) {
         case 'related_object_1':
         case 'related_object_2':
         case 'related_object_3':
             /* #DEPRECATED# */
             $retVal = eZContentObject::fetch($this->attribute('related_object_id_' . substr($attr, -1, 1)));
             break;
         default:
             $retVal = eZPersistentObject::attribute($attr);
             break;
     }
     return $retVal;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:16,代码来源:ezsubscriptionlist.php

示例5: attribute

 function attribute($attribute, $noFunction = false)
 {
     $found = false;
     switch ($attribute) {
         case 'contentobjectattribute_id':
             $val = $this->ContentObjectAttributeID;
             $found = true;
             break;
     }
     if ($found === false) {
         $val = parent::attribute($attribute, $noFunction);
     }
     return $val;
 }
开发者ID:netbliss,项目名称:ezsurvey,代码行数:14,代码来源:ezsurveyquestion.php

示例6: remoteID

 function remoteID()
 {
     $remoteID = eZPersistentObject::attribute('remote_id', true);
     if (!$remoteID) {
         $this->setAttribute('remote_id', eZRemoteIdUtility::generate('node'));
         $this->sync(array('remote_id'));
         $remoteID = eZPersistentObject::attribute('remote_id', true);
     }
     return $remoteID;
 }
开发者ID:radca,项目名称:ezpublish,代码行数:10,代码来源:ezcontentobjecttreenode.php

示例7: mimeTypePart

 function mimeTypePart()
 {
     $types = explode("/", eZPersistentObject::attribute("mime_type"));
     return $types[1];
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:5,代码来源:ezmedia.php

示例8: remoteID

    function remoteID()
    {
        $remoteID = eZPersistentObject::attribute( 'remote_id', true );

        // Ensures that we provide the correct remote_id if we have one in the database
        if ( $remoteID === null and $this->attribute( 'id' ) )
        {
            $db = eZDB::instance();
            $resultArray = $db->arrayQuery( "SELECT remote_id FROM ezcontentobject WHERE id = '" . $this->attribute( 'id' ) . "'" );
            if ( count( $resultArray ) == 1 )
            {
                $remoteID = $resultArray[0]['remote_id'];
                $this->setAttribute( 'remote_id',  $remoteID );
            }
        }

        if ( !$remoteID )
        {
            $this->setAttribute( 'remote_id', eZRemoteIdUtility::generate( 'object' ) );
            if ( $this->attribute( 'id' ) !== null )
                $this->sync( array( 'remote_id' ) );
            $remoteID = eZPersistentObject::attribute( 'remote_id', true );
        }

        return $remoteID;
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:26,代码来源:ezcontentobject.php

示例9: exportClassesArray

 function exportClassesArray()
 {
     return explode(':', eZPersistentObject::attribute('export_classes'));
 }
开发者ID:legende91,项目名称:ez,代码行数:4,代码来源:ezpdfexport.php

示例10: storeObject

 /**
  * Stores the data in $obj to database.
  *
  * Note: Transaction unsafe. If you call several transaction unsafe methods
  * you must enclose the calls within a db transaction; thus within db->begin
  * and db->commit.
  *
  * @todo Change the actual access to protected instead of just marking it as such
  * @access protected
  * @param eZPersistentObject $obj
  * @param array|null $fieldFilters If specified only certain fields will be stored.
  * @return void
  */
 public static function storeObject($obj, $fieldFilters = null)
 {
     $db = eZDB::instance();
     $useFieldFilters = isset($fieldFilters) && is_array($fieldFilters) && $fieldFilters;
     $def = $obj->definition();
     $fields = $def["fields"];
     $keys = $def["keys"];
     $table = $def["name"];
     $relations = isset($def["relations"]) ? $def["relations"] : null;
     $insert_object = false;
     $exclude_fields = array();
     foreach ($keys as $key) {
         $value = $obj->attribute($key);
         if ($value === null) {
             $insert_object = true;
             $exclude_fields[] = $key;
         }
     }
     if ($useFieldFilters) {
         $insert_object = false;
     }
     $use_fields = array_diff(array_keys($fields), $exclude_fields);
     // If we filter out some of the fields we need to intersect it with $use_fields
     if (is_array($fieldFilters)) {
         $use_fields = array_intersect($use_fields, $fieldFilters);
     }
     $doNotEscapeFields = array();
     $changedValueFields = array();
     $numericDataTypes = array('integer', 'float', 'double');
     foreach ($use_fields as $field_name) {
         $field_def = $fields[$field_name];
         $value = $obj->attribute($field_name);
         if ($value === null) {
             if (!is_array($field_def)) {
                 $exclude_fields[] = $field_name;
             } else {
                 if (array_key_exists('default', $field_def) && ($field_def['default'] !== null || $field_name == 'data_int' && array_key_exists('required', $field_def) && $field_def['required'] == false)) {
                     $obj->setAttribute($field_name, $field_def['default']);
                 } else {
                     //if ( in_array( $field_def['datatype'], $numericDataTypes )
                     $exclude_fields[] = $field_name;
                 }
             }
         }
         if (strlen($value) == 0 && is_array($field_def) && in_array($field_def['datatype'], $numericDataTypes) && array_key_exists('default', $field_def) && ($field_def['default'] === null || is_numeric($field_def['default']))) {
             $obj->setAttribute($field_name, $field_def['default']);
         }
         if ($value !== null && $field_def['datatype'] === 'string' && array_key_exists('max_length', $field_def) && $field_def['max_length'] > 0) {
             $obj->setAttribute($field_name, $db->truncateString($value, $field_def['max_length'], $field_name));
         }
         $bindDataTypes = array('text');
         if ($db->bindingType() != eZDBInterface::BINDING_NO && $db->countStringSize($value) > 2000 && is_array($field_def) && in_array($field_def['datatype'], $bindDataTypes)) {
             $boundValue = $db->bindVariable($value, $field_def);
             //                $obj->setAttribute( $field_name, $value );
             $doNotEscapeFields[] = $field_name;
             $changedValueFields[$field_name] = $boundValue;
         }
     }
     $key_conds = array();
     foreach ($keys as $key) {
         $value = $obj->attribute($key);
         $key_conds[$key] = $value;
     }
     unset($value);
     $important_keys = $keys;
     if (is_array($relations)) {
         //            $important_keys = array();
         foreach ($relations as $relation => $relation_data) {
             if (!in_array($relation, $keys)) {
                 $important_keys[] = $relation;
             }
         }
     }
     if (count($important_keys) == 0 && !$useFieldFilters) {
         $insert_object = true;
     } else {
         if (!$insert_object) {
             $rows = eZPersistentObject::fetchObjectList($def, $keys, $key_conds, array(), null, false, null, null);
             if (count($rows) == 0) {
                 /* If we only want to update some fields in a record
                  * and that records does not exist, then we should do nothing, only return.
                  */
                 if ($useFieldFilters) {
                     return;
                 }
                 $insert_object = true;
             }
//.........这里部分代码省略.........
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:101,代码来源:ezpersistentobject.php

示例11: remoteID

 function remoteID()
 {
     $remoteID = eZPersistentObject::attribute('remote_id', true);
     if (!$remoteID) {
         $this->setAttribute('remote_id', md5((string) mt_rand() . (string) time()));
         $this->sync(array('remote_id'));
         $remoteID = eZPersistentObject::attribute('remote_id', true);
     }
     return $remoteID;
 }
开发者ID:rmiguel,项目名称:ezpublish,代码行数:10,代码来源:ezcontentobjecttreenode.php

示例12: getOutputFormatArray

 /**
  * Returns available outputformats as array
  * array( id => name )
  * zb. array['0'] = 'html'
  *
  * @return array
  */
 function getOutputFormatArray()
 {
     $availableOutputFormatArray = CjwNewsletterList::getAvailableOutputFormatArray();
     $outputFormatArray = $this->stringToArray(eZPersistentObject::attribute('output_format_array_string'));
     $newOutputFormatArrayWithNames = array();
     foreach ($outputFormatArray as $outputFormatId) {
         if (array_key_exists($outputFormatId, $availableOutputFormatArray)) {
             $newOutputFormatArrayWithNames[$outputFormatId] = $availableOutputFormatArray[$outputFormatId];
         }
     }
     return $newOutputFormatArrayWithNames;
 }
开发者ID:heliopsis,项目名称:cjw_newsletter,代码行数:19,代码来源:cjwnewslettersubscription.php

示例13: getSiteaccessArray

 /**
  *
  * @return array
  */
 function getSiteaccessArray()
 {
     return $this->stringToArray(eZPersistentObject::attribute('siteaccess_array_string'));
 }
开发者ID:heliopsis,项目名称:cjw_newsletter,代码行数:8,代码来源:cjwnewsletterlist.php

示例14: attribute

 function attribute($attr, $noFunction = false)
 {
     $retVal = null;
     switch ($attr) {
         case 'related_object_1':
         case 'related_object_2':
         case 'related_object_3':
             // #DEPRECATED#
             $retVal = eZContentObject::fetch($this->attribute('related_object_id_' . substr($attr, -1, 1)));
             break;
         case 'inbox_object':
             if ($this->attribute('inbox_id')) {
                 $retVal = eZContentObject::fetch($this->attribute('inbox_id'));
             }
             break;
         case 'subscription_id_list':
             $list = eZNewsletterTypeSubscription::fetchList($this->attribute('id'), false, $this->attribute('status'));
             if ($list) {
                 $retVal = array();
                 foreach ($list as $subItem) {
                     $retVal[] = $subItem->attribute('subscription_id');
                 }
             }
             break;
         case 'default_subscription_list':
             $subscriptionListLink = eZSubscriptionList::fetch($this->attribute('defaultsubscriptionlist_id'));
             if (!$retVal) {
                 $subscriptionList = $this->attribute('subscription_list');
                 if (0 < count($subscriptionList)) {
                     $subscriptionListLink = $subscriptionList[0];
                 }
             }
             if ($subscriptionListLink) {
                 $retVal = $subscriptionListLink->attribute('subscription_object');
             }
             break;
         default:
             $retVal = eZPersistentObject::attribute($attr);
             break;
     }
     return $retVal;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:42,代码来源:eznewslettertype.php

示例15: remoteID

 function remoteID()
 {
     $remoteID = eZPersistentObject::attribute('remote_id', true);
     if (!$remoteID && $this->Version == eZContentClass::VERSION_STATUS_DEFINED) {
         $this->setAttribute('remote_id', md5((string) mt_rand() . (string) time()));
         $this->sync(array('remote_id'));
         $remoteID = eZPersistentObject::attribute('remote_id', true);
     }
     return $remoteID;
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:10,代码来源:ezcontentclass.php


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