當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Propel::log方法代碼示例

本文整理匯總了PHP中Propel\Runtime\Propel::log方法的典型用法代碼示例。如果您正苦於以下問題:PHP Propel::log方法的具體用法?PHP Propel::log怎麽用?PHP Propel::log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Propel\Runtime\Propel的用法示例。


在下文中一共展示了Propel::log方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildTip A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT id, bet, toto, joker, extra_joker, points, match_id, player_id FROM tips WHERE id = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildTip $obj */
         $obj = new ChildTip();
         $obj->hydrate($row);
         TipTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:haus23,項目名稱:dtp.model,代碼行數:32,代碼來源:TipQuery.php

示例2: doInsert

 /**
  * Insert the row in the database.
  *
  * @param      ConnectionInterface $con
  *
  * @throws PropelException
  * @see doSave()
  */
 protected function doInsert(ConnectionInterface $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[ContentTableMap::ID] = true;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . ContentTableMap::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(ContentTableMap::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(ContentTableMap::VISIBLE)) {
         $modifiedColumns[':p' . $index++] = '`VISIBLE`';
     }
     if ($this->isColumnModified(ContentTableMap::POSITION)) {
         $modifiedColumns[':p' . $index++] = '`POSITION`';
     }
     if ($this->isColumnModified(ContentTableMap::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
     }
     if ($this->isColumnModified(ContentTableMap::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
     }
     if ($this->isColumnModified(ContentTableMap::VERSION)) {
         $modifiedColumns[':p' . $index++] = '`VERSION`';
     }
     if ($this->isColumnModified(ContentTableMap::VERSION_CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`';
     }
     if ($this->isColumnModified(ContentTableMap::VERSION_CREATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`';
     }
     $sql = sprintf('INSERT INTO `content` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`VISIBLE`':
                     $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT);
                     break;
                 case '`POSITION`':
                     $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
                     break;
                 case '`CREATED_AT`':
                     $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case '`UPDATED_AT`':
                     $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case '`VERSION`':
                     $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT);
                     break;
                 case '`VERSION_CREATED_AT`':
                     $stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case '`VERSION_CREATED_BY`':
                     $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', 0, $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
開發者ID:margery,項目名稱:thelia,代碼行數:85,代碼來源:Content.php

示例3: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @return   ChildGoogleshoppingProductSynchronisation A model object, or null if the key is not found
  */
 protected function findPkSimple($key, $con)
 {
     $sql = 'SELECT ID, PRODUCT_ID, TARGET_COUNTRY, LANG, SYNC_ENABLE, GOOGLESHOPPING_ACCOUNT_ID FROM googleshopping_product_synchronisation WHERE ID = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         $obj = new ChildGoogleshoppingProductSynchronisation();
         $obj->hydrate($row);
         GoogleshoppingProductSynchronisationTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:Mertiozys,項目名稱:GoogleShopping,代碼行數:29,代碼來源:GoogleshoppingProductSynchronisationQuery.php

示例4: doInsert


//.........這裏部分代碼省略.........
         $modifiedColumns[':p' . $index++] = 'REF';
     }
     if ($this->isColumnModified(CommentTableMap::REF_ID)) {
         $modifiedColumns[':p' . $index++] = 'REF_ID';
     }
     if ($this->isColumnModified(CommentTableMap::EMAIL)) {
         $modifiedColumns[':p' . $index++] = 'EMAIL';
     }
     if ($this->isColumnModified(CommentTableMap::TITLE)) {
         $modifiedColumns[':p' . $index++] = 'TITLE';
     }
     if ($this->isColumnModified(CommentTableMap::CONTENT)) {
         $modifiedColumns[':p' . $index++] = 'CONTENT';
     }
     if ($this->isColumnModified(CommentTableMap::RATING)) {
         $modifiedColumns[':p' . $index++] = 'RATING';
     }
     if ($this->isColumnModified(CommentTableMap::STATUS)) {
         $modifiedColumns[':p' . $index++] = 'STATUS';
     }
     if ($this->isColumnModified(CommentTableMap::VERIFIED)) {
         $modifiedColumns[':p' . $index++] = 'VERIFIED';
     }
     if ($this->isColumnModified(CommentTableMap::ABUSE)) {
         $modifiedColumns[':p' . $index++] = 'ABUSE';
     }
     if ($this->isColumnModified(CommentTableMap::LOCALE)) {
         $modifiedColumns[':p' . $index++] = 'LOCALE';
     }
     if ($this->isColumnModified(CommentTableMap::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'CREATED_AT';
     }
     if ($this->isColumnModified(CommentTableMap::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'UPDATED_AT';
     }
     $sql = sprintf('INSERT INTO comment (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case 'ID':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case 'USERNAME':
                     $stmt->bindValue($identifier, $this->username, PDO::PARAM_STR);
                     break;
                 case 'CUSTOMER_ID':
                     $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT);
                     break;
                 case 'REF':
                     $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR);
                     break;
                 case 'REF_ID':
                     $stmt->bindValue($identifier, $this->ref_id, PDO::PARAM_INT);
                     break;
                 case 'EMAIL':
                     $stmt->bindValue($identifier, $this->email, PDO::PARAM_STR);
                     break;
                 case 'TITLE':
                     $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                     break;
                 case 'CONTENT':
                     $stmt->bindValue($identifier, $this->content, PDO::PARAM_STR);
                     break;
                 case 'RATING':
                     $stmt->bindValue($identifier, $this->rating, PDO::PARAM_INT);
                     break;
                 case 'STATUS':
                     $stmt->bindValue($identifier, $this->status, PDO::PARAM_INT);
                     break;
                 case 'VERIFIED':
                     $stmt->bindValue($identifier, $this->verified, PDO::PARAM_INT);
                     break;
                 case 'ABUSE':
                     $stmt->bindValue($identifier, $this->abuse, PDO::PARAM_INT);
                     break;
                 case 'LOCALE':
                     $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
                     break;
                 case 'CREATED_AT':
                     $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'UPDATED_AT':
                     $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', 0, $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
開發者ID:blump,項目名稱:Comment,代碼行數:101,代碼來源:Comment.php

示例5: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildPeople A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT id, name, date, city, street, fix_text, normal, company FROM people WHERE id = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildPeople $obj */
         $obj = new ChildPeople();
         $obj->hydrate($row);
         PeopleTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:Polymedia,項目名稱:BI-Platform-v3,代碼行數:32,代碼來源:PeopleQuery.php

示例6: doInsert

 /**
  * Insert the row in the database.
  *
  * @param      ConnectionInterface $con
  *
  * @throws PropelException
  * @see doSave()
  */
 protected function doInsert(ConnectionInterface $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[WishlistProductTableMap::COL_WISHLIST_PRODUCT_ID] = true;
     if (null !== $this->wishlist_product_id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . WishlistProductTableMap::COL_WISHLIST_PRODUCT_ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(WishlistProductTableMap::COL_WISHLIST_PRODUCT_ID)) {
         $modifiedColumns[':p' . $index++] = 'wishlist_product_id';
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_WISHLIST_ID)) {
         $modifiedColumns[':p' . $index++] = 'wishlist_id';
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_PRODUCT_ID)) {
         $modifiedColumns[':p' . $index++] = 'product_id';
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_WISHLIST_PRODUCT_COMMENT)) {
         $modifiedColumns[':p' . $index++] = 'wishlist_product_comment';
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'created_at';
     }
     if ($this->isColumnModified(WishlistProductTableMap::COL_UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'updated_at';
     }
     $sql = sprintf('INSERT INTO wishlist_product (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case 'wishlist_product_id':
                     $stmt->bindValue($identifier, $this->wishlist_product_id, PDO::PARAM_INT);
                     break;
                 case 'wishlist_id':
                     $stmt->bindValue($identifier, $this->wishlist_id, PDO::PARAM_INT);
                     break;
                 case 'product_id':
                     $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT);
                     break;
                 case 'wishlist_product_comment':
                     $stmt->bindValue($identifier, $this->wishlist_product_comment, PDO::PARAM_STR);
                     break;
                 case 'created_at':
                     $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'updated_at':
                     $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', 0, $e);
     }
     $this->setWishlistProductId($pk);
     $this->setNew(false);
 }
開發者ID:mtornero,項目名稱:slowshop,代碼行數:73,代碼來源:WishlistProduct.php

示例7: doInsert

 /**
  * Insert the row in the database.
  *
  * @param      ConnectionInterface $con
  *
  * @throws PropelException
  * @see doSave()
  */
 protected function doInsert(ConnectionInterface $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[ApplicationTableMap::COL_ID] = true;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . ApplicationTableMap::COL_ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(ApplicationTableMap::COL_ID)) {
         $modifiedColumns[':p' . $index++] = 'id';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_STUDENT_ID)) {
         $modifiedColumns[':p' . $index++] = 'student_id';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_SUBJECT_ID)) {
         $modifiedColumns[':p' . $index++] = 'subject_id';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_PERIOD_ID)) {
         $modifiedColumns[':p' . $index++] = 'period_id';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_SCHOOL_YEAR_ID)) {
         $modifiedColumns[':p' . $index++] = 'school_year_id';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_APPLICATION_DATE)) {
         $modifiedColumns[':p' . $index++] = 'application_date';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_EXAM_DATE)) {
         $modifiedColumns[':p' . $index++] = 'exam_date';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_EXAM_TIME)) {
         $modifiedColumns[':p' . $index++] = 'exam_time';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_EXAM_SCORE)) {
         $modifiedColumns[':p' . $index++] = 'exam_score';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'created_at';
     }
     if ($this->isColumnModified(ApplicationTableMap::COL_UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'updated_at';
     }
     $sql = sprintf('INSERT INTO application (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case 'id':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case 'student_id':
                     $stmt->bindValue($identifier, $this->student_id, PDO::PARAM_INT);
                     break;
                 case 'subject_id':
                     $stmt->bindValue($identifier, $this->subject_id, PDO::PARAM_INT);
                     break;
                 case 'period_id':
                     $stmt->bindValue($identifier, $this->period_id, PDO::PARAM_INT);
                     break;
                 case 'school_year_id':
                     $stmt->bindValue($identifier, $this->school_year_id, PDO::PARAM_INT);
                     break;
                 case 'application_date':
                     $stmt->bindValue($identifier, $this->application_date ? $this->application_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'exam_date':
                     $stmt->bindValue($identifier, $this->exam_date ? $this->exam_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'exam_time':
                     $stmt->bindValue($identifier, $this->exam_time ? $this->exam_time->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'exam_score':
                     $stmt->bindValue($identifier, $this->exam_score, PDO::PARAM_INT);
                     break;
                 case 'created_at':
                     $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'updated_at':
                     $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', 0, $e);
     }
//.........這裏部分代碼省略.........
開發者ID:nstojanovickg,項目名稱:diplomski,代碼行數:101,代碼來源:Application.php

示例8: doInsert

 /**
  * Insert the row in the database.
  *
  * @param      ConnectionInterface $con
  *
  * @throws PropelException
  * @see doSave()
  */
 protected function doInsert(ConnectionInterface $con)
 {
     $modifiedColumns = array();
     $index = 0;
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(ModuleImageI18nTableMap::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(ModuleImageI18nTableMap::LOCALE)) {
         $modifiedColumns[':p' . $index++] = '`LOCALE`';
     }
     if ($this->isColumnModified(ModuleImageI18nTableMap::TITLE)) {
         $modifiedColumns[':p' . $index++] = '`TITLE`';
     }
     if ($this->isColumnModified(ModuleImageI18nTableMap::DESCRIPTION)) {
         $modifiedColumns[':p' . $index++] = '`DESCRIPTION`';
     }
     if ($this->isColumnModified(ModuleImageI18nTableMap::CHAPO)) {
         $modifiedColumns[':p' . $index++] = '`CHAPO`';
     }
     if ($this->isColumnModified(ModuleImageI18nTableMap::POSTSCRIPTUM)) {
         $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`';
     }
     $sql = sprintf('INSERT INTO `module_image_i18n` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`LOCALE`':
                     $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
                     break;
                 case '`TITLE`':
                     $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                     break;
                 case '`DESCRIPTION`':
                     $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
                     break;
                 case '`CHAPO`':
                     $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR);
                     break;
                 case '`POSTSCRIPTUM`':
                     $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
     }
     $this->setNew(false);
 }
開發者ID:margery,項目名稱:thelia,代碼行數:63,代碼來源:ModuleImageI18n.php

示例9: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @return   ChildInseeGeoDepartment A model object, or null if the key is not found
  */
 protected function findPkSimple($key, $con)
 {
     $sql = 'SELECT ID, MAIN_MUNICIPALITY_ID, REGION_ID, GEO_POINT2D_X, GEO_POINT2D_Y, GEO_SHAPE, CREATED_AT, UPDATED_AT FROM insee_geo_department WHERE ID = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_STR);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         $obj = new ChildInseeGeoDepartment();
         $obj->hydrate($row);
         InseeGeoDepartmentTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:enurit,項目名稱:INSEEGeo,代碼行數:29,代碼來源:InseeGeoDepartmentQuery.php

示例10: doInsert

 /**
  * Insert the row in the database.
  *
  * @param      ConnectionInterface $con
  *
  * @throws PropelException
  * @see doSave()
  */
 protected function doInsert(ConnectionInterface $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[GroupTableMap::COL_ID] = true;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . GroupTableMap::COL_ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(GroupTableMap::COL_ID)) {
         $modifiedColumns[':p' . $index++] = 'id';
     }
     if ($this->isColumnModified(GroupTableMap::COL_NAME)) {
         $modifiedColumns[':p' . $index++] = 'name';
     }
     if ($this->isColumnModified(GroupTableMap::COL_DESCRIPTION)) {
         $modifiedColumns[':p' . $index++] = 'description';
     }
     if ($this->isColumnModified(GroupTableMap::COL_OWNER_ID)) {
         $modifiedColumns[':p' . $index++] = 'owner_id';
     }
     if ($this->isColumnModified(GroupTableMap::COL_CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'created_at';
     }
     if ($this->isColumnModified(GroupTableMap::COL_UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = 'updated_at';
     }
     $sql = sprintf('INSERT INTO group_of_users (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case 'id':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case 'name':
                     $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                     break;
                 case 'description':
                     $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
                     break;
                 case 'owner_id':
                     $stmt->bindValue($identifier, $this->owner_id, PDO::PARAM_INT);
                     break;
                 case 'created_at':
                     $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'updated_at':
                     $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', 0, $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
開發者ID:xfreddiex,項目名稱:code-sharer,代碼行數:73,代碼來源:Group.php

示例11: doInsert

 /**
  * Insert the row in the database.
  *
  * @param      ConnectionInterface $con
  *
  * @throws PropelException
  * @see doSave()
  */
 protected function doInsert(ConnectionInterface $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[UserTableMap::COL_ID] = true;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserTableMap::COL_ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(UserTableMap::COL_ID)) {
         $modifiedColumns[':p' . $index++] = 'ID';
     }
     if ($this->isColumnModified(UserTableMap::COL_USERNAME)) {
         $modifiedColumns[':p' . $index++] = 'USERNAME';
     }
     if ($this->isColumnModified(UserTableMap::COL_PASSWORD)) {
         $modifiedColumns[':p' . $index++] = 'PASSWORD';
     }
     if ($this->isColumnModified(UserTableMap::COL_FIRST_NAME)) {
         $modifiedColumns[':p' . $index++] = 'FIRST_NAME';
     }
     if ($this->isColumnModified(UserTableMap::COL_LAST_NAME)) {
         $modifiedColumns[':p' . $index++] = 'LAST_NAME';
     }
     if ($this->isColumnModified(UserTableMap::COL_CREATE_DATE)) {
         $modifiedColumns[':p' . $index++] = 'CREATE_DATE';
     }
     if ($this->isColumnModified(UserTableMap::COL_UPDATE_DATE)) {
         $modifiedColumns[':p' . $index++] = 'UPDATE_DATE';
     }
     if ($this->isColumnModified(UserTableMap::COL_STATUS)) {
         $modifiedColumns[':p' . $index++] = 'STATUS';
     }
     $sql = sprintf('INSERT INTO user (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case 'ID':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case 'USERNAME':
                     $stmt->bindValue($identifier, $this->username, PDO::PARAM_STR);
                     break;
                 case 'PASSWORD':
                     $stmt->bindValue($identifier, $this->password, PDO::PARAM_STR);
                     break;
                 case 'FIRST_NAME':
                     $stmt->bindValue($identifier, $this->first_name, PDO::PARAM_STR);
                     break;
                 case 'LAST_NAME':
                     $stmt->bindValue($identifier, $this->last_name, PDO::PARAM_STR);
                     break;
                 case 'CREATE_DATE':
                     $stmt->bindValue($identifier, $this->create_date ? $this->create_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'UPDATE_DATE':
                     $stmt->bindValue($identifier, $this->update_date ? $this->update_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                     break;
                 case 'STATUS':
                     $stmt->bindValue($identifier, $this->status, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', 0, $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
開發者ID:phpalchemy,項目名稱:cerberus,代碼行數:85,代碼來源:User.php

示例12: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @return ChildDebit A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT ID, PURCHASE_ID, TOTAL, PAID, STATUS FROM debit WHERE ID = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildDebit $obj */
         $obj = new ChildDebit();
         $obj->hydrate($row);
         DebitTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:AlvaCorp,項目名稱:POS-2,代碼行數:30,代碼來源:DebitQuery.php

示例13: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildPlayersOld A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT ID, lastn, bats, bday, age, mlb, draft_year, position, card, d_e, lg, mwbl, category, comment, mwbl_link, mlb_link, mwbl_link_enabled, mlb_link_enabled FROM players_old WHERE ID = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildPlayersOld $obj */
         $obj = new ChildPlayersOld();
         $obj->hydrate($row);
         PlayersOldTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:scornfield,項目名稱:StrayAdmin,代碼行數:32,代碼來源:PlayersOldQuery.php

示例14: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @return   ChildAccessory A model object, or null if the key is not found
  */
 protected function findPkSimple($key, $con)
 {
     $sql = 'SELECT `ID`, `PRODUCT_ID`, `ACCESSORY`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `accessory` WHERE `ID` = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         $obj = new ChildAccessory();
         $obj->hydrate($row);
         AccessoryTableMap::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:margery,項目名稱:thelia,代碼行數:29,代碼來源:AccessoryQuery.php

示例15: findPkSimple

 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     ConnectionInterface $con A connection object
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildPermissionGroupUser A model object, or null if the key is not found
  */
 protected function findPkSimple($key, ConnectionInterface $con)
 {
     $sql = 'SELECT `user_id`, `group_id` FROM `permission_group_user` WHERE `user_id` = :p0 AND `group_id` = :p1';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
         $stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
         /** @var ChildPermissionGroupUser $obj */
         $obj = new ChildPermissionGroupUser();
         $obj->hydrate($row);
         PermissionGroupUserTableMap::addInstanceToPool($obj, serialize([null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0], null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1]]));
     }
     $stmt->closeCursor();
     return $obj;
 }
開發者ID:Tekstove,項目名稱:Tekstove-api,代碼行數:33,代碼來源:PermissionGroupUserQuery.php


注:本文中的Propel\Runtime\Propel::log方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。