Ejemplo n.º 1
0
 public function testDoInsert()
 {
     try {
         $c = new Criteria();
         $c->setPrimaryTableName(BookTableMap::TABLE_NAME);
         $c->add(BookTableMap::AUTHOR_ID, 'lkhlkhj');
         $c->doInsert(Propel::getServiceContainer()->getWriteConnection(BookTableMap::DATABASE_NAME));
         $this->fail('Missing expected exception on BAD SQL');
     } catch (PropelException $e) {
         $this->assertContains('[INSERT INTO `book` (`AUTHOR_ID`) VALUES (:p1)]', $e->getMessage(), 'SQL query is written in the exception message');
     }
 }
Ejemplo n.º 2
0
 public function testCombineCriterionOrLessSimple()
 {
     $this->c->addCond('cond1', "INVOICE.COST1", "1000", Criteria::GREATER_EQUAL);
     $this->c->addCond('cond2', "INVOICE.COST2", "2000", Criteria::LESS_EQUAL);
     $this->c->add("INVOICE.COST3", "8000", Criteria::GREATER_EQUAL);
     $this->c->combine(['cond1', 'cond2'], Criteria::LOGICAL_OR);
     $this->c->addOr("INVOICE.COST4", "9000", Criteria::LESS_EQUAL);
     $expect = $this->getSql("SELECT  FROM INVOICE WHERE INVOICE.COST3>=:p1 AND ((INVOICE.COST1>=:p2 OR INVOICE.COST2<=:p3) OR INVOICE.COST4<=:p4)");
     $expect_params = [['table' => 'INVOICE', 'column' => 'COST3', 'value' => '8000'], ['table' => 'INVOICE', 'column' => 'COST1', 'value' => '1000'], ['table' => 'INVOICE', 'column' => 'COST2', 'value' => '2000'], ['table' => 'INVOICE', 'column' => 'COST4', 'value' => '9000']];
     $params = [];
     $result = $this->c->createSelectSql($params);
     $this->assertEquals($expect, $result);
     $this->assertEquals($expect_params, $params);
 }
 public function testDoInsert()
 {
     $con = Propel::getServiceContainer()->getWriteConnection(BookTableMap::DATABASE_NAME);
     try {
         $c = new Criteria();
         $c->setPrimaryTableName(BookTableMap::TABLE_NAME);
         $c->add(BookTableMap::AUTHOR_ID, 'lkhlkhj');
         $db = Propel::getServiceContainer()->getAdapter($c->getDbName());
         $c->doInsert($con);
         $this->fail('Missing expected exception on BAD SQL');
     } catch (PropelException $e) {
         if ($db->isGetIdBeforeInsert()) {
             $this->assertContains($this->getSql('[INSERT INTO book (AUTHOR_ID,ID) VALUES (:p1,:p2)]'), $e->getMessage(), 'SQL query is written in the exception message');
         } else {
             $this->assertContains($this->getSql('[INSERT INTO `book` (`AUTHOR_ID`) VALUES (:p1)]'), $e->getMessage(), 'SQL query is written in the exception message');
         }
     }
 }
 public function testDoSelectOrderByRank()
 {
     $c = new Criteria();
     $c->add(SortableTable12TableMap::SCOPE_COL, 1);
     $objects = SortableTable12Query::doSelectOrderByRank($c)->getArrayCopy();
     $oldRank = 0;
     while ($object = array_shift($objects)) {
         $this->assertTrue($object->getRank() > $oldRank);
         $oldRank = $object->getRank();
     }
     $c = new Criteria();
     $c->add(SortableTable12TableMap::SCOPE_COL, 1);
     $objects = SortableTable12Query::doSelectOrderByRank($c, Criteria::DESC)->getArrayCopy();
     $oldRank = 10;
     while ($object = array_shift($objects)) {
         $this->assertTrue($object->getRank() < $oldRank);
         $oldRank = $object->getRank();
     }
 }
Ejemplo n.º 5
0
 /**
  * Performs a DELETE on the database, given a ModuleImage or Criteria object OR a primary key value.
  *
  * @param mixed               $values Criteria or ModuleImage object or primary key or array of primary keys
  *              which is used to create the DELETE statement
  * @param ConnectionInterface $con the connection to use
  * @return int The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
  *                if supported by native driver or if emulated using Propel.
  * @throws PropelException Any exceptions caught during processing will be
  *         rethrown wrapped into a PropelException.
  */
 public static function doDelete($values, ConnectionInterface $con = null)
 {
     if (null === $con) {
         $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
     }
     if ($values instanceof Criteria) {
         // rename for clarity
         $criteria = $values;
     } elseif ($values instanceof \Thelia\Model\ModuleImage) {
         // it's a model object
         // create criteria based on pk values
         $criteria = $values->buildPkeyCriteria();
     } else {
         // it's a primary key, or an array of pks
         $criteria = new Criteria(ModuleImageTableMap::DATABASE_NAME);
         $criteria->add(ModuleImageTableMap::ID, (array) $values, Criteria::IN);
     }
     $query = ModuleImageQuery::create()->mergeWith($criteria);
     if ($values instanceof Criteria) {
         ModuleImageTableMap::clearInstancePool();
     } elseif (!is_object($values)) {
         // it's a primary key, or an array of pks
         foreach ((array) $values as $singleval) {
             ModuleImageTableMap::removeInstanceFromPool($singleval);
         }
     }
     return $query->delete($con);
 }
Ejemplo n.º 6
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(JaCategoriasTableMap::DATABASE_NAME);
     if ($this->isColumnModified(JaCategoriasTableMap::COL_ID)) {
         $criteria->add(JaCategoriasTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(JaCategoriasTableMap::COL_TITULO)) {
         $criteria->add(JaCategoriasTableMap::COL_TITULO, $this->titulo);
     }
     if ($this->isColumnModified(JaCategoriasTableMap::COL_SLUG)) {
         $criteria->add(JaCategoriasTableMap::COL_SLUG, $this->slug);
     }
     return $criteria;
 }
Ejemplo n.º 7
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(ApplicationTableMap::DATABASE_NAME);
     if ($this->isColumnModified(ApplicationTableMap::COL_ID)) {
         $criteria->add(ApplicationTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_STUDENT_ID)) {
         $criteria->add(ApplicationTableMap::COL_STUDENT_ID, $this->student_id);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_SUBJECT_ID)) {
         $criteria->add(ApplicationTableMap::COL_SUBJECT_ID, $this->subject_id);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_PERIOD_ID)) {
         $criteria->add(ApplicationTableMap::COL_PERIOD_ID, $this->period_id);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_SCHOOL_YEAR_ID)) {
         $criteria->add(ApplicationTableMap::COL_SCHOOL_YEAR_ID, $this->school_year_id);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_APPLICATION_DATE)) {
         $criteria->add(ApplicationTableMap::COL_APPLICATION_DATE, $this->application_date);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_EXAM_DATE)) {
         $criteria->add(ApplicationTableMap::COL_EXAM_DATE, $this->exam_date);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_EXAM_TIME)) {
         $criteria->add(ApplicationTableMap::COL_EXAM_TIME, $this->exam_time);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_EXAM_SCORE)) {
         $criteria->add(ApplicationTableMap::COL_EXAM_SCORE, $this->exam_score);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_CREATED_AT)) {
         $criteria->add(ApplicationTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_UPDATED_AT)) {
         $criteria->add(ApplicationTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
Ejemplo n.º 8
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(WishlistProductTableMap::DATABASE_NAME);
     if ($this->isColumnModified(WishlistProductTableMap::COL_WISHLIST_PRODUCT_ID)) {
         $criteria->add(WishlistProductTableMap::COL_WISHLIST_PRODUCT_ID, $this->wishlist_product_id);
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_WISHLIST_ID)) {
         $criteria->add(WishlistProductTableMap::COL_WISHLIST_ID, $this->wishlist_id);
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_PRODUCT_ID)) {
         $criteria->add(WishlistProductTableMap::COL_PRODUCT_ID, $this->product_id);
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_WISHLIST_PRODUCT_COMMENT)) {
         $criteria->add(WishlistProductTableMap::COL_WISHLIST_PRODUCT_COMMENT, $this->wishlist_product_comment);
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_CREATED_AT)) {
         $criteria->add(WishlistProductTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_UPDATED_AT)) {
         $criteria->add(WishlistProductTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(EntityTypeTableMap::DATABASE_NAME);
     if ($this->isColumnModified(EntityTypeTableMap::COL_ID)) {
         $criteria->add(EntityTypeTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(EntityTypeTableMap::COL_NAME)) {
         $criteria->add(EntityTypeTableMap::COL_NAME, $this->name);
     }
     return $criteria;
 }
Ejemplo n.º 10
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(SessionTableMap::DATABASE_NAME);
     if ($this->isColumnModified(SessionTableMap::COL_TOKEN)) {
         $criteria->add(SessionTableMap::COL_TOKEN, $this->token);
     }
     if ($this->isColumnModified(SessionTableMap::COL_USER_ID)) {
         $criteria->add(SessionTableMap::COL_USER_ID, $this->user_id);
     }
     if ($this->isColumnModified(SessionTableMap::COL_IP)) {
         $criteria->add(SessionTableMap::COL_IP, $this->ip);
     }
     if ($this->isColumnModified(SessionTableMap::COL_USER_AGENT)) {
         $criteria->add(SessionTableMap::COL_USER_AGENT, $this->user_agent);
     }
     if ($this->isColumnModified(SessionTableMap::COL_BROWSER)) {
         $criteria->add(SessionTableMap::COL_BROWSER, $this->browser);
     }
     if ($this->isColumnModified(SessionTableMap::COL_DEVICE)) {
         $criteria->add(SessionTableMap::COL_DEVICE, $this->device);
     }
     if ($this->isColumnModified(SessionTableMap::COL_OS)) {
         $criteria->add(SessionTableMap::COL_OS, $this->os);
     }
     if ($this->isColumnModified(SessionTableMap::COL_LOCATION)) {
         $criteria->add(SessionTableMap::COL_LOCATION, $this->location);
     }
     if ($this->isColumnModified(SessionTableMap::COL_CREATED_AT)) {
         $criteria->add(SessionTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(SessionTableMap::COL_UPDATED_AT)) {
         $criteria->add(SessionTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
Ejemplo n.º 11
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(CommentTableMap::DATABASE_NAME);
     if ($this->isColumnModified(CommentTableMap::COL_ID)) {
         $criteria->add(CommentTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(CommentTableMap::COL_USER_ID)) {
         $criteria->add(CommentTableMap::COL_USER_ID, $this->user_id);
     }
     if ($this->isColumnModified(CommentTableMap::COL_NOTE_ID)) {
         $criteria->add(CommentTableMap::COL_NOTE_ID, $this->note_id);
     }
     if ($this->isColumnModified(CommentTableMap::COL_TEXT)) {
         $criteria->add(CommentTableMap::COL_TEXT, $this->text);
     }
     if ($this->isColumnModified(CommentTableMap::COL_CREATED_AT)) {
         $criteria->add(CommentTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(CommentTableMap::COL_UPDATED_AT)) {
         $criteria->add(CommentTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
Ejemplo n.º 12
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(RigAttributeValueTableMap::DATABASE_NAME);
     if ($this->isColumnModified(RigAttributeValueTableMap::COL_ID)) {
         $criteria->add(RigAttributeValueTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(RigAttributeValueTableMap::COL_RIG_ID)) {
         $criteria->add(RigAttributeValueTableMap::COL_RIG_ID, $this->rig_id);
     }
     if ($this->isColumnModified(RigAttributeValueTableMap::COL_RIG_ATTRIBUTE_ID)) {
         $criteria->add(RigAttributeValueTableMap::COL_RIG_ATTRIBUTE_ID, $this->rig_attribute_id);
     }
     if ($this->isColumnModified(RigAttributeValueTableMap::COL_VALUE)) {
         $criteria->add(RigAttributeValueTableMap::COL_VALUE, $this->value);
     }
     return $criteria;
 }
Ejemplo n.º 13
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(UserTableMap::DATABASE_NAME);
     if ($this->isColumnModified(UserTableMap::COL_ID)) {
         $criteria->add(UserTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(UserTableMap::COL_NAME)) {
         $criteria->add(UserTableMap::COL_NAME, $this->name);
     }
     if ($this->isColumnModified(UserTableMap::COL_EMAIL)) {
         $criteria->add(UserTableMap::COL_EMAIL, $this->email);
     }
     if ($this->isColumnModified(UserTableMap::COL_PASSWORD)) {
         $criteria->add(UserTableMap::COL_PASSWORD, $this->password);
     }
     if ($this->isColumnModified(UserTableMap::COL_REMEMBER)) {
         $criteria->add(UserTableMap::COL_REMEMBER, $this->remember);
     }
     if ($this->isColumnModified(UserTableMap::COL_ACCOUNT_TYPE)) {
         $criteria->add(UserTableMap::COL_ACCOUNT_TYPE, $this->account_type);
     }
     if ($this->isColumnModified(UserTableMap::COL_CREATED_AT)) {
         $criteria->add(UserTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(UserTableMap::COL_UPDATED_AT)) {
         $criteria->add(UserTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
Ejemplo n.º 14
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(WpUsermetaTableMap::DATABASE_NAME);
     if ($this->isColumnModified(WpUsermetaTableMap::COL_UMETA_ID)) {
         $criteria->add(WpUsermetaTableMap::COL_UMETA_ID, $this->umeta_id);
     }
     if ($this->isColumnModified(WpUsermetaTableMap::COL_USER_ID)) {
         $criteria->add(WpUsermetaTableMap::COL_USER_ID, $this->user_id);
     }
     if ($this->isColumnModified(WpUsermetaTableMap::COL_META_KEY)) {
         $criteria->add(WpUsermetaTableMap::COL_META_KEY, $this->meta_key);
     }
     if ($this->isColumnModified(WpUsermetaTableMap::COL_META_VALUE)) {
         $criteria->add(WpUsermetaTableMap::COL_META_VALUE, $this->meta_value);
     }
     return $criteria;
 }
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(MenuItemVersionTableMap::DATABASE_NAME);
     $criteria->add(MenuItemVersionTableMap::ID, $this->id);
     $criteria->add(MenuItemVersionTableMap::MENU_ID, $this->menu_id);
     $criteria->add(MenuItemVersionTableMap::VERSION, $this->version);
     return $criteria;
 }
Ejemplo n.º 16
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(StudentTableMap::DATABASE_NAME);
     if ($this->isColumnModified(StudentTableMap::COL_ID)) {
         $criteria->add(StudentTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(StudentTableMap::COL_IDENTIFICATION_NUMBER)) {
         $criteria->add(StudentTableMap::COL_IDENTIFICATION_NUMBER, $this->identification_number);
     }
     if ($this->isColumnModified(StudentTableMap::COL_SCHOOL_YEAR_ID)) {
         $criteria->add(StudentTableMap::COL_SCHOOL_YEAR_ID, $this->school_year_id);
     }
     if ($this->isColumnModified(StudentTableMap::COL_COURSE_ID)) {
         $criteria->add(StudentTableMap::COL_COURSE_ID, $this->course_id);
     }
     if ($this->isColumnModified(StudentTableMap::COL_FIRST_NAME)) {
         $criteria->add(StudentTableMap::COL_FIRST_NAME, $this->first_name);
     }
     if ($this->isColumnModified(StudentTableMap::COL_LAST_NAME)) {
         $criteria->add(StudentTableMap::COL_LAST_NAME, $this->last_name);
     }
     if ($this->isColumnModified(StudentTableMap::COL_BIRTH_PLACE)) {
         $criteria->add(StudentTableMap::COL_BIRTH_PLACE, $this->birth_place);
     }
     if ($this->isColumnModified(StudentTableMap::COL_BIRTHDAY)) {
         $criteria->add(StudentTableMap::COL_BIRTHDAY, $this->birthday);
     }
     if ($this->isColumnModified(StudentTableMap::COL_PHONE_NUMBER)) {
         $criteria->add(StudentTableMap::COL_PHONE_NUMBER, $this->phone_number);
     }
     if ($this->isColumnModified(StudentTableMap::COL_CREATED_AT)) {
         $criteria->add(StudentTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(StudentTableMap::COL_UPDATED_AT)) {
         $criteria->add(StudentTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
Ejemplo n.º 17
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(JaPaginaCategoriasTableMap::DATABASE_NAME);
     if ($this->isColumnModified(JaPaginaCategoriasTableMap::COL_ID)) {
         $criteria->add(JaPaginaCategoriasTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(JaPaginaCategoriasTableMap::COL_ID_PAGINA)) {
         $criteria->add(JaPaginaCategoriasTableMap::COL_ID_PAGINA, $this->id_pagina);
     }
     if ($this->isColumnModified(JaPaginaCategoriasTableMap::COL_ID_CATEGORIA)) {
         $criteria->add(JaPaginaCategoriasTableMap::COL_ID_CATEGORIA, $this->id_categoria);
     }
     return $criteria;
 }
Ejemplo n.º 18
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(MatchTableMap::DATABASE_NAME);
     if ($this->isColumnModified(MatchTableMap::COL_ID)) {
         $criteria->add(MatchTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(MatchTableMap::COL_NR)) {
         $criteria->add(MatchTableMap::COL_NR, $this->nr);
     }
     if ($this->isColumnModified(MatchTableMap::COL_DATE)) {
         $criteria->add(MatchTableMap::COL_DATE, $this->date);
     }
     if ($this->isColumnModified(MatchTableMap::COL_RESULT)) {
         $criteria->add(MatchTableMap::COL_RESULT, $this->result);
     }
     if ($this->isColumnModified(MatchTableMap::COL_TOTO)) {
         $criteria->add(MatchTableMap::COL_TOTO, $this->toto);
     }
     if ($this->isColumnModified(MatchTableMap::COL_CHAMPIONSHIP_ID)) {
         $criteria->add(MatchTableMap::COL_CHAMPIONSHIP_ID, $this->championship_id);
     }
     if ($this->isColumnModified(MatchTableMap::COL_ROUND_ID)) {
         $criteria->add(MatchTableMap::COL_ROUND_ID, $this->round_id);
     }
     if ($this->isColumnModified(MatchTableMap::COL_LEAGUE_ID)) {
         $criteria->add(MatchTableMap::COL_LEAGUE_ID, $this->league_id);
     }
     if ($this->isColumnModified(MatchTableMap::COL_HOMETEAM_ID)) {
         $criteria->add(MatchTableMap::COL_HOMETEAM_ID, $this->hometeam_id);
     }
     if ($this->isColumnModified(MatchTableMap::COL_AWAYTEAM_ID)) {
         $criteria->add(MatchTableMap::COL_AWAYTEAM_ID, $this->awayteam_id);
     }
     return $criteria;
 }
Ejemplo n.º 19
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(DataTableMap::DATABASE_NAME);
     if ($this->isColumnModified(DataTableMap::COL_ID)) {
         $criteria->add(DataTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(DataTableMap::COL__FORCONTRIBUTION)) {
         $criteria->add(DataTableMap::COL__FORCONTRIBUTION, $this->_forcontribution);
     }
     if ($this->isColumnModified(DataTableMap::COL__FORTEMPLATEFIELD)) {
         $criteria->add(DataTableMap::COL__FORTEMPLATEFIELD, $this->_fortemplatefield);
     }
     if ($this->isColumnModified(DataTableMap::COL__CONTENT)) {
         $criteria->add(DataTableMap::COL__CONTENT, $this->_content);
     }
     if ($this->isColumnModified(DataTableMap::COL__ISJSON)) {
         $criteria->add(DataTableMap::COL__ISJSON, $this->_isjson);
     }
     if ($this->isColumnModified(DataTableMap::COL___USER__)) {
         $criteria->add(DataTableMap::COL___USER__, $this->__user__);
     }
     if ($this->isColumnModified(DataTableMap::COL___CONFIG__)) {
         $criteria->add(DataTableMap::COL___CONFIG__, $this->__config__);
     }
     if ($this->isColumnModified(DataTableMap::COL___SPLIT__)) {
         $criteria->add(DataTableMap::COL___SPLIT__, $this->__split__);
     }
     if ($this->isColumnModified(DataTableMap::COL___PARENTNODE__)) {
         $criteria->add(DataTableMap::COL___PARENTNODE__, $this->__parentnode__);
     }
     if ($this->isColumnModified(DataTableMap::COL___SORT__)) {
         $criteria->add(DataTableMap::COL___SORT__, $this->__sort__);
     }
     return $criteria;
 }
Ejemplo n.º 20
0
 public function testCommentDoDelete()
 {
     $c = new Criteria();
     $c->setComment('Foo');
     $c->add(BookTableMap::COL_TITLE, 'War And Peace');
     $con = Propel::getServiceContainer()->getConnection(BookTableMap::DATABASE_NAME);
     $c->doDelete($con);
     $expected = $this->getSql('DELETE /* Foo */ FROM `book` WHERE book.TITLE=\'War And Peace\'');
     $this->assertEquals($expected, $con->getLastExecutedQuery(), 'Criteria::setComment() adds a comment to delete queries');
 }
Ejemplo n.º 21
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(FileTableMap::DATABASE_NAME);
     if ($this->isColumnModified(FileTableMap::COL_FILE_ID)) {
         $criteria->add(FileTableMap::COL_FILE_ID, $this->file_id);
     }
     if ($this->isColumnModified(FileTableMap::COL_FILE_TYPE_ID)) {
         $criteria->add(FileTableMap::COL_FILE_TYPE_ID, $this->file_type_id);
     }
     if ($this->isColumnModified(FileTableMap::COL_FILE_PATH)) {
         $criteria->add(FileTableMap::COL_FILE_PATH, $this->file_path);
     }
     if ($this->isColumnModified(FileTableMap::COL_CREATED_AT)) {
         $criteria->add(FileTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(FileTableMap::COL_UPDATED_AT)) {
         $criteria->add(FileTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(RFieldpostprocessorForfieldTableMap::DATABASE_NAME);
     if ($this->isColumnModified(RFieldpostprocessorForfieldTableMap::COL__POSTPROCESSORID)) {
         $criteria->add(RFieldpostprocessorForfieldTableMap::COL__POSTPROCESSORID, $this->_postprocessorid);
     }
     if ($this->isColumnModified(RFieldpostprocessorForfieldTableMap::COL__TEMPLATEID)) {
         $criteria->add(RFieldpostprocessorForfieldTableMap::COL__TEMPLATEID, $this->_templateid);
     }
     return $criteria;
 }
Ejemplo n.º 23
0
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(CustomerTitleI18nTableMap::DATABASE_NAME);
     $criteria->add(CustomerTitleI18nTableMap::ID, $this->id);
     $criteria->add(CustomerTitleI18nTableMap::LOCALE, $this->locale);
     return $criteria;
 }
Ejemplo n.º 24
0
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(ProductImageTableMap::DATABASE_NAME);
     $criteria->add(ProductImageTableMap::ID, $this->id);
     return $criteria;
 }
Ejemplo n.º 25
0
 public function testModifiedObjectsRemainInTheCollection()
 {
     $c = new Criteria();
     $c->add(BookTableMap::ID, $this->books[0]->getId());
     $books = BookQuery::create(null, $c)->joinWithAuthor()->find();
     $books[0]->setTitle('Modified');
     $books2 = $books[0]->getAuthor()->getBooks();
     $this->assertEquals(2, count($books2));
     $this->assertEquals(2, $books2[0]->getAuthor()->countBooks());
     $this->assertEquals('Modified', $books2[0]->getTitle());
 }
Ejemplo n.º 26
0
 /**
  * Build a Criteria object containing the values of all modified columns in this object.
  *
  * @return Criteria The Criteria object containing all modified values.
  */
 public function buildCriteria()
 {
     $criteria = new Criteria(GroupTableMap::DATABASE_NAME);
     if ($this->isColumnModified(GroupTableMap::COL_ID)) {
         $criteria->add(GroupTableMap::COL_ID, $this->id);
     }
     if ($this->isColumnModified(GroupTableMap::COL_NAME)) {
         $criteria->add(GroupTableMap::COL_NAME, $this->name);
     }
     if ($this->isColumnModified(GroupTableMap::COL_DESCRIPTION)) {
         $criteria->add(GroupTableMap::COL_DESCRIPTION, $this->description);
     }
     if ($this->isColumnModified(GroupTableMap::COL_OWNER_ID)) {
         $criteria->add(GroupTableMap::COL_OWNER_ID, $this->owner_id);
     }
     if ($this->isColumnModified(GroupTableMap::COL_CREATED_AT)) {
         $criteria->add(GroupTableMap::COL_CREATED_AT, $this->created_at);
     }
     if ($this->isColumnModified(GroupTableMap::COL_UPDATED_AT)) {
         $criteria->add(GroupTableMap::COL_UPDATED_AT, $this->updated_at);
     }
     return $criteria;
 }
Ejemplo n.º 27
0
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(ContentTableMap::DATABASE_NAME);
     $criteria->add(ContentTableMap::ID, $this->id);
     return $criteria;
 }
Ejemplo n.º 28
0
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @throws LogicException if no primary key is defined
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(UserTableMap::DATABASE_NAME);
     $criteria->add(UserTableMap::COL_ID, $this->id);
     return $criteria;
 }
Ejemplo n.º 29
0
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(CouponVersionTableMap::DATABASE_NAME);
     $criteria->add(CouponVersionTableMap::ID, $this->id);
     $criteria->add(CouponVersionTableMap::VERSION, $this->version);
     return $criteria;
 }
Ejemplo n.º 30
0
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(OrderStatusI18nTableMap::DATABASE_NAME);
     $criteria->add(OrderStatusI18nTableMap::ID, $this->id);
     $criteria->add(OrderStatusI18nTableMap::LOCALE, $this->locale);
     return $criteria;
 }