当前位置: 首页>>代码示例>>PHP>>正文


PHP CategoryPeer::doSelect方法代码示例

本文整理汇总了PHP中CategoryPeer::doSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP CategoryPeer::doSelect方法的具体用法?PHP CategoryPeer::doSelect怎么用?PHP CategoryPeer::doSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CategoryPeer的用法示例。


在下文中一共展示了CategoryPeer::doSelect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getForExpertCategoryUserId

 static function getForExpertCategoryUserId($user_id)
 {
     $c = new Criteria();
     $c->add(ExpertCategoryPeer::USER_ID, $user_id);
     $c->addJoin(ExpertCategoryPeer::CATEGORY_ID, CategoryPeer::ID);
     return CategoryPeer::doSelect($c);
 }
开发者ID:rayku,项目名称:rayku,代码行数:7,代码来源:CategoryPeer.php

示例2: retrieveByPKs

 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(CategoryPeer::ID, $pks, Criteria::IN);
         $objs = CategoryPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
开发者ID:kotow,项目名称:work,代码行数:15,代码来源:BaseCategoryPeer.php

示例3: executeExpertReplyThread

    public function executeExpertReplyThread()
    {
        $connection = RaykuCommon::getDatabaseConnection();
        $c = new Criteria();
        $c->add(ForumPeer::TYPE, 0);
        $this->publicforums = ForumPeer::doSelect($c);
        $this->allcategories = CategoryPeer::doSelect($c = new Criteria());
        $this->forum = $this->getRequestParameter('forum_id');
        $this->thread = ThreadPeer::retrieveByPK($this->getRequestParameter('thread_id'));
        $c = new Criteria();
        $c->add(PostPeer::THREAD_ID, $this->thread->getId());
        $this->post = PostPeer::doSelectOne($c);
        $user = $this->getUser()->getRaykuUser();
        if ($this->getRequestParameter('post_edit_content') != '') {
            $threadId = $this->getRequestParameter('thread_id');
            $_thread = ThreadPeer::retrieveByPK($threadId);
            $_thread->setTitle($this->getRequestParameter('post_edit_title'));
            $_thread->save();
            $v = new Criteria();
            $v->add(PostPeer::THREAD_ID, $threadId);
            $v->addAscendingOrderByColumn(PostPeer::ID);
            $post = PostPeer::doSelectOne($v);
            $post->setContent($this->getRequestParameter('post_edit_content'));
            $post->save();
            return $this->redirect('@view_thread?thread_id=' . $threadId);
        }
        if ($this->getRequestParameter('post_body') != '') {
            if ($this->getRequestParameter('final_id') != '') {
                $_quick_reply = '';
                $_post_id = $this->getRequestParameter('final_id');
                $_Post = PostPeer::retrieveByPK($_post_id);
                $_User = UserPeer::retrieveByPK($_Post->getPosterId());
                $_quick_reply .= "<div style='margin-left:20px'><em><strong>Quote from " . $_User->getUsername() . "</strong></em><br><br>";
                $_explode_post = explode("*^-", $_Post->getContent());
                if (count($_explode_post) > 1) {
                    $_quick_reply .= $_explode_post[1];
                } else {
                    $_quick_reply .= $_Post->getContent();
                }
                $_quick_reply .= "</div>";
                $_post_body_msg = $this->getRequestParameter('post_body');
                $_quick_reply .= $_post_body_msg;
                $user->makeNewPost($this->getRequestParameter('thread_id'), $_quick_reply);
                ///////////////////updating the ip of the user
                $post_id = mysql_fetch_row(mysql_query("SELECT max(id) from post limit 0,1", $connection));
                mysql_query("update post set \tuser_ip='" . $_SERVER['REMOTE_ADDR'] . "' where id=" . $post_id[0] . "", $connection);
                ///////////////////updating the ip of the user
            } else {
                $user->makeNewPost($this->getRequestParameter('thread_id'), $this->getRequestParameter('post_body'));
                ///////////////////updating the ip of the user
                $post_id = mysql_fetch_row(mysql_query("SELECT max(id) from post limit 0,1", $connection));
                mysql_query("update post set \tuser_ip='" . $_SERVER['REMOTE_ADDR'] . "' where id=" . $post_id[0] . "", $connection);
                ///////////////////updating the ip of the user
            }
            if ($this->getUser()->getRaykuUser()->getType() == '5') {
                $c = new Criteria();
                $c->add(ThreadPeer::ID, $this->getRequestParameter('thread_id'));
                $thread = ThreadPeer::doSelectOne($c);
                $c = new Criteria();
                $c->add(UserPeer::ID, $thread->getPosterId());
                $user = UserPeer::doSelectOne($c);
                if ($thread->getNotifyPm() == '1') {
                    $subject = 'Expert Response for your Question';
                    $body = 'Hi there, <br><br>
							A Rayku expert, "' . $this->getUser()->getRaykuUser()->getName() . '" has just responsed to your question, "' . $thread->getTitle() . '" on the question boards. Take a look!<br><br>
							Rayku Administration';
                    //Grab the user object
                    $currentuser = UserPeer::retrieveByPK($this->getUser()->getRaykuUserId());
                    //Send the message
                    $currentuser->sendMessage($user->getId(), $subject, $body);
                }
                if ($thread->getNotifyEmail() == '1') {
                    $this->mail = new sfMail();
                    //Set the to, from, and subject headers
                    $this->mail->addAddress($user->getEmail());
                    $this->mail->setFrom('Expert <' . $this->getUser()->getRaykuUser()->getEmail() . '>');
                    $this->mail->setSubject('Expert Response to your Question');
                    $this->mail->setBody('Hi there,<br>
							A Rayku expert, "' . $this->getUser()->getRaykuUser()->getName() . '", has just responded to your question (below) on the question boards. Take a look!<br><br>
							' . $thread->getTitle() . '');
                    $this->mail->send();
                }
            }
            return $this->redirect('@view_thread?thread_id=' . $this->thread->getId());
        }
    }
开发者ID:rayku,项目名称:rayku,代码行数:86,代码来源:actions.class.php

示例4: executeProductCategoriesList

 public function executeProductCategoriesList()
 {
     $this->setLayout(false);
     $c = new Criteria();
     $this->categories = CategoryPeer::doSelect($c);
     $prodNum = array();
     foreach ($this->categories as $cat) {
         $id = $cat->getId();
         $products = Document::getChildrenOf($cat, "Product", false);
         // count ACTIVE childrens
         $cnt = 0;
         foreach ($products as $product) {
             if ($product->getPublicationStatus() == UtilsHelper::STATUS_ACTIVE) {
                 $cnt++;
             }
         }
         $prodNum[$id] = $cnt;
     }
     $this->prodNum = $prodNum;
     $this->currentId = $this->getRequestParameter("Category_id");
 }
开发者ID:kotow,项目名称:work,代码行数:21,代码来源:actions.class.php

示例5: executeCategories

 public function executeCategories()
 {
     $this->user = $this->getRequestParameter('userid');
     $c = new Criteria();
     $c->addJoin(CategoryPeer::ID, ExpertCategoryPeer::CATEGORY_ID, Criteria::JOIN);
     $c->add(ExpertCategoryPeer::USER_ID, $this->getRequestParameter('userid'));
     $this->usercategories = CategoryPeer::doSelect($c);
     $cat = new Criteria();
     $subSelect = "category.id NOT IN (\n\t\t\tSELECT\n\t\t\t\t  category_id\n\t\t\tFROM\n\t\t\t\t  expert_category\n\t\t\tWHERE\n\t\t\t\t expert_category.user_id = " . $this->getRequestParameter('userid') . "\n\t\t\t)";
     $cat->add(CategoryPeer::ID, $subSelect, Criteria::CUSTOM);
     $this->unjoinedcategories = CategoryPeer::doSelect($cat);
 }
开发者ID:rayku,项目名称:rayku,代码行数:12,代码来源:actions.class.php

示例6: getCategorysRelatedByParentId

 /**
  * Gets an array of Category objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this Category has previously been saved, it will retrieve
  * related CategorysRelatedByParentId from storage. If this Category is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array Category[]
  * @throws     PropelException
  */
 public function getCategorysRelatedByParentId($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(CategoryPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collCategorysRelatedByParentId === null) {
         if ($this->isNew()) {
             $this->collCategorysRelatedByParentId = array();
         } else {
             $criteria->add(CategoryPeer::PARENT_ID, $this->id);
             CategoryPeer::addSelectColumns($criteria);
             $this->collCategorysRelatedByParentId = CategoryPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(CategoryPeer::PARENT_ID, $this->id);
             CategoryPeer::addSelectColumns($criteria);
             if (!isset($this->lastCategoryRelatedByParentIdCriteria) || !$this->lastCategoryRelatedByParentIdCriteria->equals($criteria)) {
                 $this->collCategorysRelatedByParentId = CategoryPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastCategoryRelatedByParentIdCriteria = $criteria;
     return $this->collCategorysRelatedByParentId;
 }
开发者ID:alexspark21,项目名称:symfony_bisM,代码行数:44,代码来源:BaseCategory.php

示例7: textarea_tag

    ?>
    <?php 
}
?>
    <div class="expert"><strong>Post:</strong></div>
    <div class="spacer"></div>
    <?php 
echo textarea_tag('post_body', '', array('style' => 'height: 130px; width: 100%;'));
?>
    <div class="spacer"></div>
    <?php 
if (empty($threadID)) {
    ?>
    <?php 
    $c = new Criteria();
    $categories = CategoryPeer::doSelect($c);
    ?>
    <div class="expert"><strong>Select category :</strong></div>
    <div class="spacer"></div>
    <select name="category_id">
      <?php 
    foreach ($categories as $categorie) {
        ?>
      <option value="<?php 
        echo $categorie->getId();
        ?>
">
      <?php 
        echo $categorie->getName();
        ?>
      </option>
开发者ID:rayku,项目名称:rayku,代码行数:31,代码来源:_makePostForm.php


注:本文中的CategoryPeer::doSelect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。