Пример #1
0
 function testBasic()
 {
     $row = new Row($this->table, array("id" => 3), true);
     $this->assertTrue($row->isDirty());
     $row->refresh();
     $this->assertEquals(array("id" => "3", "created" => new \pq\DateTime("tomorrow"), "counter" => "1", "number" => "1.1", "data" => "tomorrow", "list" => array(1, 2, 3), "prop" => null), $row->getData());
     $this->assertFalse($row->isDirty());
 }
Пример #2
0
 /**
  * Add an array of head items to the table
  * 
  * @param array|Surface\Row $head
  * @return \Surface
  */
 public function setHead($head)
 {
     if (!$head instanceof Row) {
         $head = new Row($head);
     }
     foreach ($head->getData() as $headItem) {
         $headItem->setElementType(Element::TH);
     }
     $this->_head = $head;
     return $this;
 }