title: How to define dependency in cdbcache in yii framework for php?
body: <p>I have enable the dbcache in php by addin this code in main.php file</p>
  
  <pre><code> 'cache'=&gt;array(
              'class'=&gt;'system.caching.CDbCache',
          'connectionID'=&gt;'db',
          ),
  </code></pre>
  
  <p>Now I want to define dependancy for this cache for checking last updated record but i am unable to do this.</p>
  
  <p>the query is:-</p>
  
  <pre><code>public function actionProductList()
      {
          $model=new Product();
          $main=array();
          /* $random =Product::model()-&gt;find(array(
          'select'=&gt;'MAX(update_time)',
          ));
          $dependency =new CDbCacheDependency($random);
          var_dump($random);*/
          $productList1=Product::model()-&gt;cache(60)-&gt;with('productimages')-&gt;findAll();
          foreach($productList1 as $productList)
          {
              $main1=array();
              foreach($productList-&gt;productimages as $list)
              {
                  if($list-&gt;isProfileImage==1)
                  {
              $main1[]=array("path"=&gt;$list-&gt;path,"imageId"=&gt;$list-&gt;imageId);
              }
              }
              if($productList-&gt;isPublish==1)
              {
                  $main[]=array("productId"=&gt;$productList-&gt;productId,"productName"=&gt;$productList-&gt;productName,
                                  "brandId"=&gt;$productList-&gt;brandId,"mrp"=&gt;$productList-&gt;mrp,
                                  "isTaxInclude"=&gt;$productList-&gt;isTaxInclude,"isAvailable"=&gt;$productList-&gt;isAvailable,
                                  "isFreeDelivery"=&gt;$productList-&gt;isFreeDelivery,"description"=&gt;$productList-&gt;description,
                                  "isPublish"=&gt;$productList-&gt;isPublish,"publishDate"=&gt;$productList-&gt;publishDate,
                                  "isActive"=&gt;$productList-&gt;isActive,"userId"=&gt;$productList-&gt;userId,
                                  "createDate"=&gt;$productList-&gt;createDate,"ipAddress"=&gt;$productList-&gt;ipAddress,
                                  "offerPrice"=&gt;$productList-&gt;offerPrice,"manufactureId"=&gt;$productList-&gt;manufactureId,"proimage"=&gt;$main1);
          }
          }   
              echo"{\"Product\":".CJSON::encode($main)."}";
  
      }
  </code></pre>
  
  <p>and i have no update_time field in product table so how i can achieve dependency for this query...</p>