本文整理匯總了PHP中Gpf_DbEngine_Row::getTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gpf_DbEngine_Row::getTable方法的具體用法?PHP Gpf_DbEngine_Row::getTable怎麽用?PHP Gpf_DbEngine_Row::getTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gpf_DbEngine_Row
的用法示例。
在下文中一共展示了Gpf_DbEngine_Row::getTable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadRow
protected function loadRow(Gpf_DbEngine_Row $row) {
$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
$selectBuilder->from->add($row->getTable()->name());
$selectBuilder->select->addAll($row->getTable());
foreach ($this->uniqueColumnNames as $columnName=>$value) {
if ($value === false) {
$selectBuilder->where->add($columnName,'=',$row->get($columnName));
continue;
}
$selectBuilder->where->add($columnName,'=',$value);
}
return $selectBuilder->getOneRow();
}
示例2: validate
/**
* Validate Db_Row
*
* @param Gpf_DbEngine_Row $row
* @throws Gpf_DbEngine_Row_ConstraintException
*/
public function validate(Gpf_DbEngine_Row $row)
{
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->add('COUNT(*)', 'cnt');
$select->from->add($row->getTable()->name());
foreach ($row->getPrimaryColumns() as $primaryColumn) {
$select->where->add($primaryColumn->getName(), '<>', $row->get($primaryColumn->getName()));
}
$conditionNotEqalColumns = new Gpf_SqlBuilder_CompoundWhereCondition();
foreach ($this->columnsNotEqualNames as $columnNotEqualName) {
$conditionNotEqalColumns->add($columnNotEqualName, '=', $row->get($this->columnName), 'OR');
}
$select->where->addCondition($conditionNotEqalColumns);
$select->limit->set(0, 1);
if ($select->getOneRow()->get('cnt') > 0) {
$this->throwException();
}
}