Example #1
0
 /**
  * Get the value of this Record's title column.
  * @return string
  */
 public function get_title()
 {
     $title_col = $this->table->get_title_column();
     if ($title_col !== $this->table->get_pk_column()) {
         $title_col_name = $title_col->get_name();
         return $this->data->{$title_col_name};
     } else {
         $title_parts = array();
         foreach ($this->table->get_columns() as $col) {
             $col_name = $col->get_name() . self::FKTITLE;
             $title_parts[] = $this->{$col_name}();
         }
         return '[ ' . join(' | ', $title_parts) . ' ]';
     }
 }
Example #2
0
 /**
  * Get the value of this Record's title column.
  * @return string
  */
 public function get_title()
 {
     $title_col_name = $this->table->get_title_column()->get_name();
     return $this->data->{$title_col_name};
 }