Esempio n. 1
0
 /**
  * Generates a name for the Relationship (primarily for use by LsVersionableListener)
  *
  * @return  string  The generated name
  */
 public function getName()
 {
     //return generic name if components are missing
     if (!$this->category_id) {
         $ret = 'Relationship';
     } else {
         $ret = RelationshipCategoryTable::getDisplayNameById($this->category_id);
     }
     $ret .= ' ' . $this->id;
     if ($this->is_deleted) {
         $ret .= ' [deleted]';
     }
     return $ret;
 }
 static function getName($rel)
 {
     //return generic name if components are missing
     if (!$rel['Entity1']['name'] || !$rel['Entity2']['name'] || !$rel['category_id']) {
         $ret = 'Relationship';
     }
     $ret = RelationshipCategoryTable::getDisplayNameById($rel['category_id']) . ': ' . $rel['Entity1']['name'] . ', ' . $rel['Entity2']['name'];
     if ($rel['is_deleted']) {
         $ret .= ' [deleted]';
     }
     return $ret;
 }