Exemplo n.º 1
0
 public function __construct($fields = array())
 {
     parent::__construct($fields);
     # Set primogenitor
     if ($this->field('primogenitor_id')) {
         $this->primogenitor = $this->find_by_id($this->field('primogenitor_id'));
     }
     if ($this->field('editor')) {
         $this->editor = User::find_by_name($this->field('editor'));
     }
 }
 public function testTableSchema()
 {
     $neechy = new NeechyModel();
     $schema = trim($neechy->get_schema());
     $this->assertStringStartsWith('CREATE TABLE neeches', $schema);
     $this->assertStringEndsWith('ENGINE=MyISAM', $schema);
 }