本文整理汇总了PHP中ModelJoin::hasLeftTableAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP ModelJoin::hasLeftTableAlias方法的具体用法?PHP ModelJoin::hasLeftTableAlias怎么用?PHP ModelJoin::hasLeftTableAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelJoin
的用法示例。
在下文中一共展示了ModelJoin::hasLeftTableAlias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Define the joined hydration schema based on a join object.
* Fills the ModelWith properties using a ModelJoin as source
*
* @param ModelJoin $join
*/
public function init(ModelJoin $join)
{
$tableMap = $join->getTableMap();
$this->modelName = $tableMap->getClassname();
$this->modelPeerName = $tableMap->getPeerClassname();
$this->isSingleTableInheritance = $tableMap->isSingleTableInheritance();
$relation = $join->getRelationMap();
if ($relation->getType() == RelationMap::ONE_TO_MANY) {
$this->isAdd = true;
$this->relationName = $relation->getName() . 's';
$this->relationMethod = 'add' . $relation->getName();
} else {
$this->relationName = $relation->getName();
$this->relationMethod = 'set' . $relation->getName();
}
if (!$join->isPrimary()) {
$this->relatedClass = $join->hasLeftTableAlias() ? $join->getLeftTableAlias() : $relation->getLeftTable()->getPhpName();
}
}
示例2: init
/**
* Define the joined hydration schema based on a join object.
* Fills the ModelWith properties using a ModelJoin as source
*
* @param ModelJoin $join
*/
public function init(ModelJoin $join)
{
$tableMap = $join->getTableMap();
$this->modelName = $tableMap->getClassname();
$this->modelPeerName = $tableMap->getPeerClassname();
$this->isSingleTableInheritance = $tableMap->isSingleTableInheritance();
$relation = $join->getRelationMap();
$relationName = $relation->getName();
if ($relation->getType() == RelationMap::ONE_TO_MANY) {
$this->isAdd = $this->isWithOneToMany = true;
$this->relationName = $relationName . 's';
$this->relationMethod = 'add' . $relationName;
$this->initMethod = 'init' . $relationName . 's';
} else {
$this->relationName = $relationName;
$this->relationMethod = 'set' . $relationName;
}
$this->rightPhpName = $join->hasRelationAlias() ? $join->getRelationAlias() : $relationName;
if (!$join->isPrimary()) {
$this->leftPhpName = $join->hasLeftTableAlias() ? $join->getLeftTableAlias() : $join->getPreviousJoin()->getRelationMap()->getName();
}
}