コード例 #1
0
 /**
  * {@inheritdoc}
  *
  * @param array $values
  *   An array of values to set, keyed by property name. A value for the
  *   vocabulary ID ('vid') is required.
  */
 public function create(array $values = array())
 {
     // Save new terms with no parents by default.
     if (empty($values['parent'])) {
         $values['parent'] = array(0);
     }
     $entity = parent::create($values);
     return $entity;
 }