/**
  * Parse existing comments for searching types or comments for property
  *
  * @param CComponent $object
  */
 public function setTypeAndComment(CComponent $object)
 {
     if (property_exists($object, $this->name)) {
         $data = DocBlockParser::parseProperty($object, $this->name)->var;
         $this->_readType = $this->_writeType = $data['type'];
         $this->_readComment = $this->_writeComment = $data['comment'];
     }
     if ($object->canSetProperty($this->name)) {
         $data = DocBlockParser::parseMethod($object, 'set' . $this->name)->params;
         $first = array_shift($data);
         //get first param of setter
         $this->_writeType = $first['type'];
         $this->_writeComment = $first['comment'];
     }
     if ($object->canGetProperty($this->name)) {
         $data = DocBlockParser::parseMethod($object, 'get' . $this->name)->return;
         $this->_readType = $data['type'];
         $this->_readComment = $data['comment'];
     }
     if ($object->hasEvent($this->name)) {
         $parser = DocBlockParser::parseMethod($object, $this->name);
         $this->_writeType = $this->_readType = "CList";
         $this->_writeComment = $this->_readComment = $parser->getShortDescription();
     }
     if ($object instanceof CActiveRecord) {
         //from relations
         $rels = $object->relations();
         if (array_key_exists($this->name, $rels)) {
             list($relType, $type) = $rels[$this->name];
             $returnArrayTypes = array(CActiveRecord::HAS_MANY, CActiveRecord::MANY_MANY);
             if (in_array($relType, $returnArrayTypes)) {
                 $type = $type . '[]';
             }
             if ($relType == CActiveRecord::STAT) {
                 $type = 'int|null';
             }
             $this->_writeType = $this->_readType = $type;
         }
         //from attrubutes
         $attrs = $object->getAttributes();
         if (array_key_exists($this->name, $attrs)) {
             $metaData = $object->getMetaData();
             $this->_writeType = $this->_readType = $metaData->columns[$this->name]->type;
         }
     }
 }