当前位置: 首页>>代码示例>>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;未经允许,请勿转载。