當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Association::property方法代碼示例

本文整理匯總了PHP中Cake\ORM\Association::property方法的典型用法代碼示例。如果您正苦於以下問題:PHP Association::property方法的具體用法?PHP Association::property怎麽用?PHP Association::property使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cake\ORM\Association的用法示例。


在下文中一共展示了Association::property方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: property

 /**
  * Sets the property name that should be filled with data from the target table
  * in the source table record.
  * If no arguments are passed, currently configured type is returned.
  *
  * @param string|null $name The name of the property. Pass null to read the current value.
  * @return string
  */
 public function property($name = null)
 {
     if ($name !== null) {
         return parent::property($name);
     }
     if ($name === null && !$this->_propertyName) {
         list(, $name) = pluginSplit($this->_name);
         $this->_propertyName = Inflector::underscore(Inflector::singularize($name));
     }
     return $this->_propertyName;
 }
開發者ID:wepbunny,項目名稱:cake2,代碼行數:19,代碼來源:HasOne.php

示例2: _save

 /**
  * Helper method for saving an association's data.
  *
  * @param Association $association The association object to save with.
  * @param Entity $entity The entity to save
  * @param array $nested Options for deeper associations
  * @param array $options Original options
  * @return bool Success
  */
 protected function _save($association, $entity, $nested, $options)
 {
     if (!$entity->dirty($association->property())) {
         return true;
     }
     if (!empty($nested)) {
         $options = (array) $nested + $options;
     }
     return (bool) $association->save($entity, $options);
 }
開發者ID:ripzappa0924,項目名稱:carte0.0.1,代碼行數:19,代碼來源:Associations.php

示例3: addToJoinsMap

 /**
  * Registers a table alias, typically loaded as a join in a query, as belonging to
  * an association. This helps hydrators know what to do with the columns coming
  * from such joined table.
  *
  * @param string $alias The table alias as it appears in the query.
  * @param \Cake\ORM\Association $assoc The association object the alias represents;
  * will be normalized
  * @param bool $asMatching Whether or not this join results should be treated as a
  * 'matching' association.
  * @param string $targetProperty The property name where the results of the join should be nested at.
  * If not passed, the default property for the association will be used.
  * @return void
  */
 public function addToJoinsMap($alias, Association $assoc, $asMatching = false, $targetProperty = null)
 {
     $this->_joinsMap[$alias] = new EagerLoadable($alias, ['aliasPath' => $alias, 'instance' => $assoc, 'canBeJoined' => true, 'forMatching' => $asMatching, 'targetProperty' => $targetProperty ?: $assoc->property()]);
 }
開發者ID:nrother,項目名稱:cakephp,代碼行數:18,代碼來源:EagerLoader.php


注:本文中的Cake\ORM\Association::property方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。