当前位置: 首页>>代码示例>>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;未经允许,请勿转载。