本文整理汇总了PHP中Criterion::getTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Criterion::getTable方法的具体用法?PHP Criterion::getTable怎么用?PHP Criterion::getTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Criterion
的用法示例。
在下文中一共展示了Criterion::getTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCriterionTable
/**
* method supporting recursion through all criterions to give
* us a string array of tables from each criterion
* @return void
*/
private function addCriterionTable(Criterion $c, &$s)
{
$s[] = $c->getTable();
$clauses = $c->getClauses();
$clausesLength = count($clauses);
for ($i = 0; $i < $clausesLength; $i++) {
$this->addCriterionTable($clauses[$i], $s);
}
}
示例2: addCriterionTable
/**
* method supporting recursion through all criterions to give
* us a string array of tables from each criterion
* @return void
*/
private function addCriterionTable(Criterion $c, &$s)
{
$s[] = $c->getTable();
foreach ($c->getClauses() as $clause) {
$this->addCriterionTable($clause, $s);
}
}
示例3: _createSqlFromCriterion
private function _createSqlFromCriterion(Criterion $aCriterion)
{
//var_dump( $aCriterion );
//$this->_hidden_criterion->getTable()
// echo $aCriterion->getColumn();
// echo $aCriterion->getValue();
// echo $aCriterion->getComparison();
// var_dump( $aCriterion->getAllTables() );
// var_dump( $aCriterion->getAttachedCriterion() );
// var_dump( $aCriterion->getTable() );
$table = $aCriterion->getTable() ? $aCriterion->getTable() . '.' : '';
$value = $aCriterion->getValue();
if (is_array($value)) {
foreach ($value as $key => $val) {
$value[$key] = "'" . chks($val) . "'";
}
if (count($value)) {
$value = '(' . implode(',', $value) . ')';
} else {
$value = '( NULL )';
}
} else {
if (!is_null($value) && !is_numeric($value)) {
$value = "'" . chks($value) . "'";
}
}
if (is_null($value)) {
if (self::EQUAL == $aCriterion->getComparison() || self::ISNULL == $aCriterion->getComparison() || self::IN == $aCriterion->getComparison()) {
$partWhere = trim($table . $aCriterion->getColumn(), '.') . " IS NULL";
} else {
$partWhere = trim($table . $aCriterion->getColumn(), '.') . " IS NOT NULL";
}
} else {
$partWhere = trim($table . $aCriterion->getColumn(), '.') . $aCriterion->getComparison() . $value;
}
$clauses = $aCriterion->getClauses();
if (is_array($clauses) && count($clauses)) {
$conjunctions = $aCriterion->getConjunctions();
for ($i = 0; $i < count($clauses); $i++) {
$partWhere = '(' . $partWhere . ')' . $conjunctions[$i] . $this->_createSqlFromCriterion($clauses[$i]);
}
}
return $partWhere;
}