本文整理汇总了PHP中Propel\Runtime\ActiveQuery\ModelCriteria::getTableMap方法的典型用法代码示例。如果您正苦于以下问题:PHP ModelCriteria::getTableMap方法的具体用法?PHP ModelCriteria::getTableMap怎么用?PHP ModelCriteria::getTableMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Runtime\ActiveQuery\ModelCriteria
的用法示例。
在下文中一共展示了ModelCriteria::getTableMap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* PropelChoiceListLoader constructor.
*
* @param ChoiceListFactoryInterface $factory
* @param string $class
*/
public function __construct(ChoiceListFactoryInterface $factory, $class, ModelCriteria $queryObject, $useAsIdentifier = null)
{
$this->factory = $factory;
$this->class = $class;
$this->query = $queryObject;
if ($useAsIdentifier) {
$this->identifier = array($this->query->getTableMap()->getColumn($useAsIdentifier));
} else {
$this->identifier = $this->query->getTableMap()->getPrimaryKeys();
}
if (1 === count($this->identifier) && $this->isScalar(current($this->identifier))) {
$this->identifierAsIndex = true;
}
}
示例2: getBackEndI18n
public static function getBackEndI18n(ModelCriteria &$search, $requestedLocale, $columns = array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), $foreignTable = null, $foreignKey = 'ID')
{
if ($foreignTable === null) {
$foreignTable = $search->getTableMap()->getName();
$aliasPrefix = '';
} else {
$aliasPrefix = $foreignTable . '_';
}
$requestedLocaleI18nAlias = $aliasPrefix . 'requested_locale_i18n';
$requestedLocaleJoin = new Join();
$requestedLocaleJoin->addExplicitCondition($search->getTableMap()->getName(), $foreignKey, null, $foreignTable . '_i18n', 'ID', $requestedLocaleI18nAlias);
$requestedLocaleJoin->setJoinType(Criteria::LEFT_JOIN);
$search->addJoinObject($requestedLocaleJoin, $requestedLocaleI18nAlias)->addJoinCondition($requestedLocaleI18nAlias, '`' . $requestedLocaleI18nAlias . '`.LOCALE = ?', $requestedLocale, null, \PDO::PARAM_STR);
$search->withColumn('NOT ISNULL(`' . $requestedLocaleI18nAlias . '`.`ID`)', $aliasPrefix . 'IS_TRANSLATED');
foreach ($columns as $column) {
$search->withColumn('`' . $requestedLocaleI18nAlias . '`.`' . $column . '`', $aliasPrefix . 'i18n_' . $column);
}
}
示例3: paginate
public function paginate(ModelCriteria $query, $page = 1, $maxPerPage = 25)
{
$queryMd5 = md5($query->toString());
$key = $query->getTableMap()->getName() . '_query_' . $queryMd5 . '_' . $page . '_' . $maxPerPage;
$records = GlobalCache::get($key);
if (empty($records) === true) {
$records = $query->paginate($page, $maxPerPage);
if ($records->isEmpty() === false) {
GlobalCache::set($key, $records);
}
}
return $records;
}
示例4: getColumnsList
/**
* @param \Propel\Runtime\ActiveQuery\ModelCriteria $query
* @param \Spryker\Zed\Gui\Communication\Table\TableConfiguration $config
*
* @return array
*/
protected function getColumnsList(ModelCriteria $query, TableConfiguration $config)
{
if ($config->getHeader()) {
return array_keys($config->getHeader());
}
return array_keys($query->getTableMap()->getColumns());
}