public function __construct(Database_Row $row)
 {
     $this->row = $row;
     $table = $row->get_table();
     $form_name = $table->get_name() . '_editing';
     parent::__construct($table, $form_name);
     $this->add_hidden_input('id', $this->row->get_id());
 }
 /**
  * Remember:
  *
  * SELECT foo.bar AS foo__bar ...
  *
  * get it to work.
  */
 public function get($field_name)
 {
     if (preg_match('/^(\\w+)(?:\\.|__)(\\w+)$/', $field_name, $matches)) {
         $table_name = $matches[1];
         $just_field_name = $matches[2];
         return parent::get($table_name . '__' . $field_name);
     } else {
         return parent::get($field_name);
     }
 }
 public function __construct($table, $row)
 {
     if (!isset($row['product_count'])) {
         parent::__construct($table, $row);
     } else {
         $this->product_count = $row['product_count'];
         unset($row['product_count']);
         parent::__construct($table, $row);
     }
 }
 public function __construct($table, $field_values)
 {
     parent::__construct($table, $field_values);
     $this->behaviours = array();
     $this->set_behaviours();
 }
 public function get_row_editing_form_field_input(Database_Row $row, $name)
 {
     $table = $row->get_table();
     $field = $table->get_field($name);
     $field_renderer = $field->get_renderer();
     $input = $field_renderer->get_form_input();
     $input->set_value($row->get($name));
     return $input;
 }