本文整理匯總了PHP中Propel\Runtime\ActiveQuery\Criteria::addSelectColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP Criteria::addSelectColumn方法的具體用法?PHP Criteria::addSelectColumn怎麽用?PHP Criteria::addSelectColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Propel\Runtime\ActiveQuery\Criteria
的用法示例。
在下文中一共展示了Criteria::addSelectColumn方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCreateSelectSqlPart
public function testCreateSelectSqlPart()
{
Propel::getServiceContainer()->setAdapter('oracle', new OracleAdapter());
$db = Propel::getServiceContainer()->getAdapter();
$c = new Criteria();
$c->addSelectColumn(BookTableMap::COL_ID);
$c->addAsColumn('book_ID', BookTableMap::COL_ID);
$fromClause = [];
$selectSql = $db->createSelectSqlPart($c, $fromClause);
$this->assertEquals('SELECT book.id, book.id AS book_ID', $selectSql, 'createSelectSqlPart() returns a SQL SELECT clause with both select and as columns');
$this->assertEquals(['book'], $fromClause, 'createSelectSqlPart() adds the tables from the select columns to the from clause');
}
示例2: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(ContentI18nTableMap::ID);
$criteria->addSelectColumn(ContentI18nTableMap::LOCALE);
$criteria->addSelectColumn(ContentI18nTableMap::TITLE);
$criteria->addSelectColumn(ContentI18nTableMap::DESCRIPTION);
$criteria->addSelectColumn(ContentI18nTableMap::CHAPO);
$criteria->addSelectColumn(ContentI18nTableMap::POSTSCRIPTUM);
$criteria->addSelectColumn(ContentI18nTableMap::META_TITLE);
$criteria->addSelectColumn(ContentI18nTableMap::META_DESCRIPTION);
$criteria->addSelectColumn(ContentI18nTableMap::META_KEYWORDS);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.LOCALE');
$criteria->addSelectColumn($alias . '.TITLE');
$criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.CHAPO');
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
$criteria->addSelectColumn($alias . '.META_TITLE');
$criteria->addSelectColumn($alias . '.META_DESCRIPTION');
$criteria->addSelectColumn($alias . '.META_KEYWORDS');
}
}
示例3: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(DiaporamaVersionTableMap::ID);
$criteria->addSelectColumn(DiaporamaVersionTableMap::SHORTCODE);
$criteria->addSelectColumn(DiaporamaVersionTableMap::CREATED_AT);
$criteria->addSelectColumn(DiaporamaVersionTableMap::UPDATED_AT);
$criteria->addSelectColumn(DiaporamaVersionTableMap::VERSION);
$criteria->addSelectColumn(DiaporamaVersionTableMap::VERSION_CREATED_AT);
$criteria->addSelectColumn(DiaporamaVersionTableMap::VERSION_CREATED_BY);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.SHORTCODE');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
$criteria->addSelectColumn($alias . '.VERSION');
$criteria->addSelectColumn($alias . '.VERSION_CREATED_AT');
$criteria->addSelectColumn($alias . '.VERSION_CREATED_BY');
}
}
示例4: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(JudgeTableMap::COL_ID);
$criteria->addSelectColumn(JudgeTableMap::COL_POSITION);
$criteria->addSelectColumn(JudgeTableMap::COL_STARTGROUP_ID);
$criteria->addSelectColumn(JudgeTableMap::COL_USER_ID);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.position');
$criteria->addSelectColumn($alias . '.startgroup_id');
$criteria->addSelectColumn($alias . '.user_id');
}
}
示例5: testCreateSelectSqlPartAliasAll
public function testCreateSelectSqlPartAliasAll()
{
$db = Propel::getServiceContainer()->getAdapter(BookTableMap::DATABASE_NAME);
$c = new Criteria();
$c->addSelectColumn(BookTableMap::COL_ID);
$c->addAsColumn('book_id', BookTableMap::COL_ID);
$fromClause = [];
$selectSql = $db->createSelectSqlPart($c, $fromClause, true);
$this->assertEquals('SELECT book.id AS book_id_1, book.id AS book_id', $selectSql, 'createSelectSqlPart() aliases all columns if passed true as last parameter');
$this->assertEquals([], $fromClause, 'createSelectSqlPart() does not add the tables from an all-aliased list of select columns');
}
示例6: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(LockTableMap::COL_ID);
$criteria->addSelectColumn(LockTableMap::COL_CREATINGDATETIME);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.CREATINGDATETIME');
}
}
示例7: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(EveApiTableMap::COL_ID);
$criteria->addSelectColumn(EveApiTableMap::COL_USERID);
$criteria->addSelectColumn(EveApiTableMap::COL_KEYID);
$criteria->addSelectColumn(EveApiTableMap::COL_VCODE);
$criteria->addSelectColumn(EveApiTableMap::COL_STATUS);
$criteria->addSelectColumn(EveApiTableMap::COL_LASTCOMPUTED);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.userId');
$criteria->addSelectColumn($alias . '.keyId');
$criteria->addSelectColumn($alias . '.vCode');
$criteria->addSelectColumn($alias . '.status');
$criteria->addSelectColumn($alias . '.lastComputed');
}
}
示例8: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(BookTableMap::COL_ID);
$criteria->addSelectColumn(BookTableMap::COL_TITLE);
$criteria->addSelectColumn(BookTableMap::COL_ISBN);
$criteria->addSelectColumn(BookTableMap::COL_PUBLISHER_ID);
$criteria->addSelectColumn(BookTableMap::COL_AUTHOR_ID);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.title');
$criteria->addSelectColumn($alias . '.isbn');
$criteria->addSelectColumn($alias . '.publisher_id');
$criteria->addSelectColumn($alias . '.author_id');
}
}
示例9: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(StructureNodeTableMap::COL_ID);
$criteria->addSelectColumn(StructureNodeTableMap::COL_TYPE);
$criteria->addSelectColumn(StructureNodeTableMap::COL_SKILL_ID);
$criteria->addSelectColumn(StructureNodeTableMap::COL_TITLE);
$criteria->addSelectColumn(StructureNodeTableMap::COL_DESCENDANT_CLASS);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.type');
$criteria->addSelectColumn($alias . '.skill_id');
$criteria->addSelectColumn($alias . '.title');
$criteria->addSelectColumn($alias . '.descendant_class');
}
}
示例10: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(AttributeAvTableMap::ID);
$criteria->addSelectColumn(AttributeAvTableMap::ATTRIBUTE_ID);
$criteria->addSelectColumn(AttributeAvTableMap::POSITION);
$criteria->addSelectColumn(AttributeAvTableMap::CREATED_AT);
$criteria->addSelectColumn(AttributeAvTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.ATTRIBUTE_ID');
$criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
}
示例11: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_ID);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_MIN);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_MAX);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_RANGE);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_MEDIAN);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_AVERAGE);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_VARIANCE);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_STANDARD_DEVIATION);
$criteria->addSelectColumn(PerformanceStatisticTableMap::COL_VARIABILITY_COEFFICIENT);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.min');
$criteria->addSelectColumn($alias . '.max');
$criteria->addSelectColumn($alias . '.range');
$criteria->addSelectColumn($alias . '.median');
$criteria->addSelectColumn($alias . '.average');
$criteria->addSelectColumn($alias . '.variance');
$criteria->addSelectColumn($alias . '.standard_deviation');
$criteria->addSelectColumn($alias . '.variability_coefficient');
}
}
示例12: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(MediafileTableMap::COL_IDMEDIAFILE);
$criteria->addSelectColumn(MediafileTableMap::COL_FILE_LOCATION);
$criteria->addSelectColumn(MediafileTableMap::COL_SIZE);
$criteria->addSelectColumn(MediafileTableMap::COL_TIMESTAMP);
$criteria->addSelectColumn(MediafileTableMap::COL_MIMETYPE);
} else {
$criteria->addSelectColumn($alias . '.idMediaFile');
$criteria->addSelectColumn($alias . '.file_location');
$criteria->addSelectColumn($alias . '.size');
$criteria->addSelectColumn($alias . '.timestamp');
$criteria->addSelectColumn($alias . '.mimetype');
}
}
示例13: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(GameTableMap::COL_ID);
$criteria->addSelectColumn(GameTableMap::COL_MODALITY);
$criteria->addSelectColumn(GameTableMap::COL_RESULT);
$criteria->addSelectColumn(GameTableMap::COL_BET_COST);
$criteria->addSelectColumn(GameTableMap::COL_START);
$criteria->addSelectColumn(GameTableMap::COL_FINISH);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.modality');
$criteria->addSelectColumn($alias . '.result');
$criteria->addSelectColumn($alias . '.bet_cost');
$criteria->addSelectColumn($alias . '.start');
$criteria->addSelectColumn($alias . '.finish');
}
}
示例14: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(TemplateTableMap::ID);
$criteria->addSelectColumn(TemplateTableMap::CREATED_AT);
$criteria->addSelectColumn(TemplateTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
}
示例15: addSelectColumns
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(ResourceTypeTableMap::COL_RESOURCE_TYPE_ID);
$criteria->addSelectColumn(ResourceTypeTableMap::COL_RESOURCE_TYPE_CODE);
} else {
$criteria->addSelectColumn($alias . '.resource_type_id');
$criteria->addSelectColumn($alias . '.resource_type_code');
}
}