/** * Saves any changes to this record in the database on the Database Server. * * @return boolean TRUE, if successful. * object. * @throws FileMakerException */ public function commit() { if ($this->fm->getProperty('prevalidate')) { $validation = $this->validate(); if (FileMaker::isError($validation)) { return $validation; } } if (is_null($this->parent)) { if ($this->recordId) { return $this->_commitEdit(); } else { return $this->_commitAdd(); } } else { if (!$this->parent->getRecordId()) { throw new FileMakerException($this->fm, 'You must commit the parent record first before you can commit its children.'); } if ($this->recordId) { return $this->_commitEditChild(); } else { return $this->_commitAddChild(); } } }
/** * Loads extended (FMPXMLLAYOUT) layout information. * * @access private * * @param string $recid Record from which to load extended information. * * @return boolean TRUE, if successful. * @throws FileMakerException; */ public function loadExtendedInfo($recid = null) { if (!$this->extended) { if ($recid != null) { $result = $this->fm->execute(array('-db' => $this->fm->getProperty('database'), '-lay' => $this->getName(), '-recid' => $recid, '-view' => null), 'FMPXMLLAYOUT'); } else { $result = $this->fm->execute(array('-db' => $this->fm->getProperty('database'), '-lay' => $this->getName(), '-view' => null), 'FMPXMLLAYOUT'); } $parser = new FMPXMLLAYOUT($this->fm); $parseResult = $parser->parse($result); $parser->setExtendedInfo($this); $this->extended = true; } return $this->extended; }
function _getCommandParams() { $queryParams = array('-db' => $this->fm->getProperty('database'), '-lay' => $this->_layout); foreach (array('_script' => '-script', '_preReqScript' => '-script.prefind', '_preSortScript' => '-script.presort') as $varName => $paramName) { if ($this->{$varName}) { $queryParams[$paramName] = $this->{$varName}; $varName .= 'Params'; if ($this->{$varName} !== null) { $queryParams[$paramName . '.param'] = $this->{$varName}; } } } if ($this->_resultLayout) { $queryParams['-lay.response'] = $this->_resultLayout; } return $queryParams; }