示例#1
0
 /**
  * Add support for special HABTM syntax.
  *
  * Sets this helper's model and field properties to the dot-separated value-pair in $entity.
  *
  * @param mixed $entity A field name, like "ModelName.fieldName" or "ModelName.ID.fieldName"
  * @param boolean $setScope Sets the view scope to the model specified in $tagValue
  * @return void
  */
 function setEntity($entity, $setScope = false)
 {
     parent::setEntity($entity, $setScope);
     $parts = explode('.', $entity);
     $field = $this->_introspectModel($this->_modelScope, 'fields', $parts[0]);
     if (!empty($field) && $field['type'] === 'multiple') {
         $this->_entityPath = $parts[0] . '.' . $parts[0];
     }
 }