Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 14th, 2012  |  syntax: None  |  size: 0.89 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. public function __construct($parent_id = false)
  4.         {
  5.                
  6.                 $this->article = new Article();
  7.                 if ($parent_id) {
  8.                         $this->params = SeriesParamList::getList('article', $parent_id);
  9.                         $this->article->series_id = $parent_id;
  10.                 } else {
  11.  
  12.                                 $criteria = new CDbCriteria;
  13.                                 $criteria->compare('param_class', 'article');
  14.                                 $criteria->compare('param_name', 'status');
  15.                                 $this->params = SeriesParamList::model()->with('values')->findAll($criteria);
  16.                
  17.                 }
  18.                
  19.                         $this->myParams = new CAttributeCollection;
  20.                         foreach ($this->params as $thisParam) {
  21.                                 $this->myParams->add($thisParam->param_name, "");
  22.                         }
  23.                 $this->articleInfo = new ArticleInfo();
  24.                 $this->media = new Media();
  25.                 $this->mediaInfo = new MediaInfo();
  26.                 $this->photos = array();
  27.                 $this->photoUploads = array();
  28.                 $this->photoUpdates = array();
  29.                                 $this->needsTranslation = false;
  30.                 parent::__construct();
  31.         }
  32.  
  33. ?>