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


PHP self::setData方法代码示例

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


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

示例1: buildReverseTree

 /**
  * Generates a form to define the reverse values of a specific property for a resource
  * This allows to set/remove multiple triples that share the same object   
  * 
  * @param core_kernel_classes_Resource $resource
  * @param core_kernel_classes_Property $property
  * @return tao_helpers_form_GenerisTreeForm
  */
 public static function buildReverseTree(core_kernel_classes_Resource $resource, core_kernel_classes_Property $property)
 {
     $tree = new self($resource, $property);
     $domainCollection = $property->getDomain();
     if (!$domainCollection->isEmpty()) {
         $domain = $domainCollection->get(0);
         $tree->setData('rootNode', $domain->getUri());
         $tree->setData('dataUrl', _url('getData', 'GenerisTree', 'tao'));
         $tree->setData('saveUrl', _url('setReverseValues', 'GenerisTree', 'tao'));
         $values = array_keys($domain->searchInstances(array($property->getUri() => $resource), array('recursive' => true, 'like' => false)));
         $tree->setData('values', $values);
         $openNodeUris = tao_models_classes_GenerisTreeFactory::getNodesToOpen($values, $domain);
         $tree->setData('openNodes', $openNodeUris);
     }
     return $tree;
 }
开发者ID:nagyist,项目名称:tao-core,代码行数:24,代码来源:class.GenerisTreeForm.php

示例2: findAllByOptionValue

 public function findAllByOptionValue($value_id, $customer_id)
 {
     $tmp_cards = $this->getTable()->findAllByOptionValue($value_id, $customer_id);
     $cards = array();
     $remove_cards = false;
     if (!empty($tmp_cards)) {
         foreach ($tmp_cards as $tmp_card) {
             $card = new self();
             $card->setData($tmp_card->getData());
             $is_locked = false;
             if (!is_null($card->getLastError())) {
                 $now = $this->formatDate(null, 'y-MM-dd HH:mm:ss');
                 $date = new Zend_Date($card->getLastError());
                 $last_error = $date->addDay(1)->toString('y-MM-dd HH:mm:ss');
                 $is_locked = $last_error > $now && $card->getNumberOfError() >= 3;
                 if (!$last_error > $now) {
                     $card->setNumberOfError(0);
                 }
             }
             $card->setIsLocked($is_locked)->setId($card->getCustomerCardId());
             // Si la carte est bloquée, on ne conserve que celle là, on supprime les autres et on stop le traitement
             if ($is_locked) {
                 $cards = array($card);
                 break;
             } else {
                 $cards[] = $card;
             }
         }
     }
     return $cards;
 }
开发者ID:bklein01,项目名称:SiberianCMS,代码行数:31,代码来源:Customer.php

示例3: getInstance

 /**
  * Function to get the instance of the Tracker Record Model from the list of key-value mapping
  * @param <Array> $valueMap
  * @return Vtiger_TrackRecord_Model instance
  */
 public static function getInstance($valueMap)
 {
     $instance = new self();
     $instance->setData($valueMap);
     $instance->setModule($valueMap['module_name']);
     return $instance;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:12,代码来源:TrackRecord.php

示例4: make

 /**
  * Create a new pattern template from array.
  *
  * @param  array $data
  * @return Raincolour\Containers\Template
  */
 public static function make(array $data)
 {
     $template = new self();
     $template->setData($data);
     $template->validate();
     return $template;
 }
开发者ID:jmaurice,项目名称:colour-schemes,代码行数:13,代码来源:Template.php

示例5: fromException

 static function fromException($exception)
 {
     $exceptionClass = get_class($exception);
     $response = new self();
     if ($exception instanceof \RpcException) {
         $response->setHttpStatus($exception->getHttpStatus());
         $response->setCode($exception->getRpcErrorCode());
         $response->setData(['data' => $exception->getData(), 'trace' => $exception->getTrace()]);
     } else {
         $response->setHttpStatus(500);
         $response->setCode('UNKOWN');
         $response->setData(['trace' => $exception->getTrace()]);
     }
     $response->setMessage($exception->getMessage());
     return $response;
 }
开发者ID:robertblackwell,项目名称:srmn,代码行数:16,代码来源:ErrorResponse.php

示例6: getInstance

 /**
  * Function to get the instance of the Tracker Record Model from the list of key-value mapping
  * @param <Array> $valueMap
  * @return Vtiger_TrackRecord_Model instance
  */
 public static function getInstance($valueMap)
 {
     global $log;
     $log->debug("Entering ./models/TrackRecord.php::staticgetInstance");
     $instance = new self();
     $instance->setData($valueMap);
     $instance->setModule($valueMap['module_name']);
     return $instance;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:14,代码来源:TrackRecord.php

示例7: getInstanceFromLinkObject

 /**
  * Function to get the instance of CSS Script model from a given Vtiger_Link object
  * @param Vtiger_Link $linkObj
  * @return Vtiger_CssScript_Model instance
  */
 public static function getInstanceFromLinkObject(Vtiger_Link $linkObj)
 {
     $objectProperties = get_object_vars($linkObj);
     $linkModel = new self();
     foreach ($objectProperties as $properName => $propertyValue) {
         $linkModel->{$properName} = $propertyValue;
     }
     return $linkModel->setData($objectProperties);
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:14,代码来源:CssScript.php

示例8: factory

 public static function factory(array $data)
 {
     $rpc = new self();
     $rpc->setId($data['tid']);
     $rpc->setAction($data['action']);
     $rpc->setMethod($data['method']);
     $rpc->setData($data['data'] ?: array());
     $rpc->setParameters($data);
     return $rpc;
 }
开发者ID:shraddhanegi,项目名称:KJSencha,代码行数:10,代码来源:RPC.php

示例9: getInstanceById

	public static function getInstanceById($id)
	{
		$db = PearDatabase::getInstance();
		$result = $db->pquery('SELECT * FROM yetiforce_menu WHERE id = ?;', [$id]);
		if ($db->num_rows($result) == 0)
			return false;

		$instance = new self();
		$instance->setData($db->raw_query_result_rowdata($result, 0));
		return $instance;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:11,代码来源:Record.php

示例10: __set

 /**
  * Método mágico (atribui)
  * @param	string $key
  * @param	mixed $value
  * @return	void
  */
 public function __set($key, $value)
 {
     if (is_array($value)) {
         $config = new self();
         $value = $config->setData($value);
     }
     if (null === $key) {
         $this->data[] = $value;
     } else {
         $this->data[$key] = $value;
     }
 }
开发者ID:paulofreitasnobrega,项目名称:gemak,代码行数:18,代码来源:ConfigAbstract.php

示例11: getInstanceByCreator

 public static function getInstanceByCreator(Users_Record_Model $user)
 {
     $db = PearDatabase::getInstance();
     $query = 'SELECT * FROM ' . self::tableName . ' WHERE creatorid=?';
     $result = $db->pquery($query, array($user->getId()));
     $instance = new self();
     if ($db->num_rows($result) > 0) {
         $row = $db->query_result_rowdata($result, 0);
         $instance->setData($row);
     }
     return $instance;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:12,代码来源:Announcement.php

示例12: getInstanceById

	public static function getInstanceById($reportModel) {
		$self = new self();
		$db = PearDatabase::getInstance();
		$result = $db->pquery('SELECT * FROM vtiger_reporttype WHERE reportid = ?', array($reportModel->getId()));
		$data = $db->query_result($result, 0, 'data');
		if(!empty($data)) {
			$decodeData = Zend_Json::decode(decode_html($data));
			$self->setData($decodeData);
			$self->setParent($reportModel);
			$self->setId($reportModel->getId());
		}
		return $self;
	}
开发者ID:Wasage,项目名称:werpa,代码行数:13,代码来源:Chart.php

示例13: getUserInstance

    public static function getUserInstance($widgetId)
    {
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $db = PearDatabase::getInstance();
        $result = $db->pquery('SELECT vtiger_module_dashboard_widgets.* FROM vtiger_module_dashboard_widgets 
			INNER JOIN vtiger_links ON vtiger_links.linkid = vtiger_module_dashboard_widgets.linkid 
			WHERE linktype = ? AND vtiger_module_dashboard_widgets.id = ? AND vtiger_module_dashboard_widgets.userid = ?', array('DASHBOARDWIDGET', $widgetId, $currentUser->getId()));
        $self = new self();
        if ($db->num_rows($result)) {
            $row = $db->query_result_rowdata($result, 0);
            $self->setData($row);
        }
        return $self;
    }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:14,代码来源:Notebook.php

示例14: create

 public static function create($filters = null, $data = null, $accountBookingFilters = null)
 {
     if (!$filters) {
         throw new Exception('No filters specified');
     }
     if (!$data) {
         throw new Exception('No data specified');
     }
     $obj = new self();
     $obj->setFilters($filters);
     $obj->setData($data);
     $obj->setAccountBookingFilters($accountBookingFilters);
     return $obj;
 }
开发者ID:carriercomm,项目名称:Billing-5,代码行数:14,代码来源:PrintFibuDefinition.php

示例15: load

 /**
  * Static method for loading a Config instance.
  *
  * @param  string|array $path
  *
  * @return Config
  */
 public static function load($path)
 {
     $self = new self([]);
     $paths = $self->getValidPath($path);
     $data = [];
     foreach ($paths as $path) {
         // Get file information
         $info = pathinfo($path);
         $extension = isset($info['extension']) ? $info['extension'] : '';
         $parser = $self->getParser($extension);
         // Try and load file
         $data = array_replace_recursive($data, $parser->parse($path));
     }
     $self->setData($data);
     return $self;
 }
开发者ID:parfumix,项目名称:config,代码行数:23,代码来源:Config.php


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