createRow() public method

Fetches a new blank row (not from the database).
public createRow ( array $data = [], string $defaultSource = null ) : Zend_Db_Table_Row_Abstract
$data array OPTIONAL data to populate in the new row.
$defaultSource string OPTIONAL flag to force default values into new row
return Zend_Db_Table_Row_Abstract
示例#1
0
 /**
  * Populate Row FromEntry
  *
  * @param Postr_Model_Entry $entry
  * @param Zend_Db_Table_Row_Abstract $entryRow
  * @return Zend_Db_Table_Row_Abstract
  */
 protected function _populateRowFromEntry(Postr_Model_Entry $entry, Zend_Db_Table_Row_Abstract $entryRow = null)
 {
     if (null === $entryRow) {
         $entryRow = $this->_entryTable->createRow();
     }
     $entryRow->id = $entry->getId();
     $entryRow->title = $entry->getTitle();
     $entryRow->content = $entry->getContent();
     $entryRow->summary = $entry->getSummary();
     $entryRow->updated = $entry->getUpdated()->get(Zend_Date::ISO_8601);
     $entryRow->published = $entry->getPublished()->get(Zend_Date::ISO_8601);
     return $entryRow;
 }
示例#2
0
	public function __construct($id = false) {
		$this->table = new $this->tableClassName;
		if ($id) {
			$this->loadRow($id);
		}
		else {
			$this->row = $this->table->createRow();
		}
	}