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


PHP ContentPeer::retrieveByPK方法代碼示例

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


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

示例1: deleteContent

 function deleteContent($data, $fields)
 {
     $obj = new Content();
     $ConCategory = $fields['CON_CATEGORY'];
     $ConParent = $fields['CON_PARENT'];
     $ConId = $fields['CON_ID'];
     $ConLang = $fields['CON_LANG'];
     try {
         //$res = $obj->load($ConCategory, $ConParent, $ConId, $ConLang );
         $content = ContentPeer::retrieveByPK($ConCategory, $ConParent, $ConId, $ConLang);
         if ($content) {
             $content->delete();
         }
     } catch (Exception $e) {
         return $e;
     }
     return $res;
 }
開發者ID:emildev35,項目名稱:processmaker,代碼行數:18,代碼來源:classContentTest.php

示例2: removeLanguageContent

 function removeLanguageContent($lanId)
 {
     try {
         $c = new Criteria();
         $c->addSelectColumn(ContentPeer::CON_CATEGORY);
         $c->addSelectColumn(ContentPeer::CON_PARENT);
         $c->addSelectColumn(ContentPeer::CON_ID);
         $c->addSelectColumn(ContentPeer::CON_LANG);
         $c->add(ContentPeer::CON_LANG, $lanId);
         $result = ContentPeer::doSelectRS($c);
         $result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $result->next();
         $row = $result->getRow();
         while (is_array($row)) {
             $content = ContentPeer::retrieveByPK($row['CON_CATEGORY'], '', $row['CON_ID'], $lanId);
             if ($content !== null) {
                 $content->delete();
             }
             $result->next();
             $row = $result->getRow();
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:nshong,項目名稱:processmaker,代碼行數:25,代碼來源:Content.php

示例3: delete

 /**
  * Implementation for 'DELETE' method for Rest API
  *
  * @param  mixed $conCategory, $conParent, $conId, $conLang Primary key
  *
  * @return array $result Returns array within multiple records or a single record depending if
  *                       a single selection was requested passing id(s) as param
  */
 protected function delete($conCategory, $conParent, $conId, $conLang)
 {
     $conn = Propel::getConnection(ContentPeer::DATABASE_NAME);
     try {
         $conn->begin();
         $obj = ContentPeer::retrieveByPK($conCategory, $conParent, $conId, $conLang);
         if (!is_object($obj)) {
             throw new RestException(412, G::LoadTranslation('ID_RECORD_DOES_NOT_EXIST'));
         }
         $obj->delete();
         $conn->commit();
     } catch (Exception $e) {
         $conn->rollback();
         throw new RestException(412, $e->getMessage());
     }
 }
開發者ID:emildev35,項目名稱:processmaker,代碼行數:24,代碼來源:Content.php

示例4: updateInsertContent

 public function updateInsertContent($content, $field, $value)
 {
     if (isset($content[$field]['en'])) {
         //update
         $con = ContentPeer::retrieveByPK($field, '', $this->getAppUid(), 'en');
         $con->setConValue($value);
         if ($con->validate()) {
             $res = $con->save();
         }
     } else {
         //insert
         $con = new Content();
         $con->setConCategory($field);
         $con->setConParent('');
         $con->setConId($this->getAppUid());
         $con->setConLang('en');
         $con->setConValue($value);
         if ($con->validate()) {
             $res = $con->save();
         }
     }
 }
開發者ID:bqevin,項目名稱:processmaker,代碼行數:22,代碼來源:Application.php

示例5: delete

 /**
  * Implementation for 'DELETE' method for Rest API
  *
  * @param  mixed $conCategory, $conParent, $conId, $conLang Primary key
  *
  * @return array $result Returns array within multiple records or a single record depending if
  *                       a single selection was requested passing id(s) as param
  */
 protected function delete($conCategory, $conParent, $conId, $conLang)
 {
     $conn = Propel::getConnection(ContentPeer::DATABASE_NAME);
     try {
         $conn->begin();
         $obj = ContentPeer::retrieveByPK($conCategory, $conParent, $conId, $conLang);
         if (!is_object($obj)) {
             throw new RestException(412, 'Record does not exist.');
         }
         $obj->delete();
         $conn->commit();
     } catch (Exception $e) {
         $conn->rollback();
         throw new RestException(412, $e->getMessage());
     }
 }
開發者ID:rodrigoivan,項目名稱:processmaker,代碼行數:24,代碼來源:Content.php


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