本文整理汇总了PHP中eZ\Publish\Core\Persistence\Database\DatabaseHandler::alias方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseHandler::alias方法的具体用法?PHP DatabaseHandler::alias怎么用?PHP DatabaseHandler::alias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZ\Publish\Core\Persistence\Database\DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler::alias方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSearchableFieldMapData
/**
* Returns searchable field mapping data
*
* @return array
*/
public function getSearchableFieldMapData()
{
$query = $this->dbHandler->createSelectQuery();
$query->select($this->dbHandler->alias($this->dbHandler->quoteColumn("identifier", "ezcontentclass_attribute"), $this->dbHandler->quoteIdentifier("field_definition_identifier")), $this->dbHandler->alias($this->dbHandler->quoteColumn("identifier", "ezcontentclass"), $this->dbHandler->quoteIdentifier("content_type_identifier")), $this->dbHandler->alias($this->dbHandler->quoteColumn("id", "ezcontentclass_attribute"), $this->dbHandler->quoteIdentifier("field_definition_id")), $this->dbHandler->alias($this->dbHandler->quoteColumn("data_type_string", "ezcontentclass_attribute"), $this->dbHandler->quoteIdentifier("field_type_identifier")))->from($this->dbHandler->quoteTable("ezcontentclass_attribute"))->innerJoin($this->dbHandler->quoteTable("ezcontentclass"), $query->expr->eq($this->dbHandler->quoteColumn("contentclass_id", "ezcontentclass_attribute"), $this->dbHandler->quoteColumn("id", "ezcontentclass")))->where($query->expr->eq($this->dbHandler->quoteColumn("is_searchable", "ezcontentclass_attribute"), $query->bindValue(1, null, PDO::PARAM_INT)));
$statement = $query->prepare($query);
$statement->execute();
return $statement->fetchAll(\PDO::FETCH_ASSOC);
}
示例2: getContentInfoList
/**
* Get sorted arrays of content IDs, which should be returned
*
* @param Criterion $filter
* @param array $sort
* @param mixed $offset
* @param mixed $limit
* @param mixed $translations
*
* @return int[]
*/
protected function getContentInfoList( Criterion $filter, $sort, $offset, $limit, $translations )
{
$query = $this->handler->createSelectQuery();
$query->selectDistinct(
'ezcontentobject.*',
$this->handler->aliasedColumn( $query, 'main_node_id', 'main_tree' )
);
if ( $sort !== null )
{
$this->sortClauseConverter->applySelect( $query, $sort );
}
$query->from(
$this->handler->quoteTable( 'ezcontentobject' )
)->innerJoin(
'ezcontentobject_version',
'ezcontentobject.id',
'ezcontentobject_version.contentobject_id'
)->leftJoin(
$this->handler->alias(
$this->handler->quoteTable( 'ezcontentobject_tree' ),
$this->handler->quoteIdentifier( 'main_tree' )
),
$query->expr->lAnd(
$query->expr->eq(
$this->handler->quoteColumn( "contentobject_id", "main_tree" ),
$this->handler->quoteColumn( "id", "ezcontentobject" )
),
$query->expr->eq(
$this->handler->quoteColumn( "main_node_id", "main_tree" ),
$this->handler->quoteColumn( "node_id", "main_tree" )
)
)
);
if ( $sort !== null )
{
$this->sortClauseConverter->applyJoin( $query, $sort );
}
$query->where(
$this->getQueryCondition( $filter, $query, $translations )
);
if ( $sort !== null )
{
$this->sortClauseConverter->applyOrderBy( $query );
}
$query->limit( $limit, $offset );
$statement = $query->prepare();
$statement->execute();
return $statement->fetchAll( \PDO::FETCH_ASSOC );
}
示例3: getFieldMap
/**
* Returns field mapping data
*
* Returns an associative array with ContentType and FieldDefinition identifiers as
* first and second level keys respectively, and FieldDefinition ID as value.
*
* @return array
*/
public function getFieldMap()
{
$query = $this->dbHandler->createSelectQuery();
$query->select($this->dbHandler->alias($this->dbHandler->quoteColumn("id", "ezcontentclass_attribute"), $this->dbHandler->quoteIdentifier("field_id")), $this->dbHandler->alias($this->dbHandler->quoteColumn("identifier", "ezcontentclass_attribute"), $this->dbHandler->quoteIdentifier("field_identifier")), $this->dbHandler->alias($this->dbHandler->quoteColumn("identifier", "ezcontentclass"), $this->dbHandler->quoteIdentifier("type_identifier")))->from($this->dbHandler->quoteTable("ezcontentclass_attribute"))->innerJoin($this->dbHandler->quoteTable("ezcontentclass"), $query->expr->eq($this->dbHandler->quoteColumn("contentclass_id", "ezcontentclass_attribute"), $this->dbHandler->quoteColumn("id", "ezcontentclass")));
$statement = $query->prepare($query);
$statement->execute();
$map = array();
$rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
foreach ($rows as $row) {
$map[$row["type_identifier"]][$row["field_identifier"]] = $row["field_id"];
}
return $map;
}