本文整理汇总了PHP中PhabricatorLiskDAO::establishConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorLiskDAO::establishConnection方法的具体用法?PHP PhabricatorLiskDAO::establishConnection怎么用?PHP PhabricatorLiskDAO::establishConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorLiskDAO
的用法示例。
在下文中一共展示了PhabricatorLiskDAO::establishConnection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCustomTransactionNewValue
protected function getCustomTransactionNewValue(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
{
switch ($xaction->getTransactionType()) {
case PhabricatorProjectTransaction::TYPE_NAME:
case PhabricatorProjectTransaction::TYPE_STATUS:
case PhabricatorProjectTransaction::TYPE_IMAGE:
case PhabricatorProjectTransaction::TYPE_ICON:
case PhabricatorProjectTransaction::TYPE_COLOR:
case PhabricatorProjectTransaction::TYPE_LOCKED:
case PhabricatorProjectTransaction::TYPE_PARENT:
return $xaction->getNewValue();
case PhabricatorProjectTransaction::TYPE_SLUGS:
return $this->normalizeSlugs($xaction->getNewValue());
case PhabricatorProjectTransaction::TYPE_MILESTONE:
$current = queryfx_one($object->establishConnection('w'), 'SELECT MAX(milestoneNumber) n
FROM %T
WHERE parentProjectPHID = %s', $object->getTableName(), $object->getParentProject()->getPHID());
if (!$current) {
$number = 1;
} else {
$number = (int) $current['n'] + 1;
}
return $number;
}
return parent::getCustomTransactionNewValue($object, $xaction);
}
示例2: loadStandardPageRows
protected function loadStandardPageRows(PhabricatorLiskDAO $table)
{
$conn = $table->establishConnection('r');
$rows = queryfx_all($conn, '%Q FROM %T %Q %Q %Q %Q %Q %Q %Q', $this->buildSelectClause($conn), $table->getTableName(), (string) $this->getPrimaryTableAlias(), $this->buildJoinClause($conn), $this->buildWhereClause($conn), $this->buildGroupClause($conn), $this->buildHavingClause($conn), $this->buildOrderClause($conn), $this->buildLimitClause($conn));
return $rows;
}