本文整理匯總了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());
}