src/Database/ORM/Traits/Relationships.php
/**
	 * This model is derived from another model.
	 *
	 * @param string $model
	 * @param string $localKey
	 * @param string $parentKey
	 * @return BelongsToOneRelationship
	 */
This model is derived from another model.
@param string $model
@param string $localKey
@param string $parentKey
@return BelongsToOneRelationship
This model is derived from another model . @param string $model @param string $localKey @param string $parentKey @return BelongsToOneRelationship
protected function belongsTo($model, $localKey = null, $parentKey = null) {
		$o = new $model;
		if (is_null($localKey)) {
			$localKey = StringBuilder::getSingularModelName($model) . '_' . $o->getPrimaryKey();
		}
		if (is_null($parentKey)) {
			$parentKey = $o->getPrimaryKey();
		}
		unset($o);
		return new BelongsToOneRelationship($this, $model, $parentKey, $localKey);
	}
protected function belongsTo ( $ model , $ localKey = null , $ parentKey = null ) { $ o = new $ model ; if ( is_null ( $ localKey ) ) { $ localKey = StringBuilder :: getSingularModelName ( $ model ) . '_' . $ o -> getPrimaryKey ( ) ; } if ( is_null ( $ parentKey ) ) { $ parentKey = $ o -> getPrimaryKey ( ) ; } unset ( $ o ) ; return new BelongsToOneRelationship ( $ this , $ model , $ parentKey , $ localKey ) ; }
This model is derived from another model.
This model is derived from another model .