本文整理汇总了PHP中WebVista_Model_ORM::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP WebVista_Model_ORM::persist方法的具体用法?PHP WebVista_Model_ORM::persist怎么用?PHP WebVista_Model_ORM::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebVista_Model_ORM
的用法示例。
在下文中一共展示了WebVista_Model_ORM::persist方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: persist
public function persist()
{
if (!$this->dateTime || $this->dateTime == '0000-00-00 00:00:00') {
$this->dateTime = date('Y-m-d H:i:s');
}
return parent::persist();
}
示例2: persist
public function persist()
{
if (!strlen($this->guid) > 0) {
$this->guid = str_replace('-', '', NSDR::create_guid());
}
return parent::persist();
}
示例3: persist
public function persist()
{
$this->homeAddress->type = 'HOME';
$this->billingAddress->type = 'BILL';
parent::persist();
$this->person->persist();
}
示例4: persist
public function persist()
{
if ($this->_persistMode != WebVista_Model_ORM::DELETE && (int) $this->program_order === 0) {
$this->program_order = self::maxProgramOrder($this) + 1;
}
return parent::persist();
}
示例5: persist
public function persist()
{
$claimFileId = (int) $this->claimFileId;
if (!$claimFileId > 0) {
$this->claimFileId = $this->nextSequenceId('claimSequences');
}
return parent::persist();
}
示例6: persist
public function persist()
{
if ($this->_persistMode == WebVista_Model_ORM::DELETE) {
$db = Zend_Registry::get("dbAdapter");
$db->delete($this->_table, 'healthStatusHandlerId=' . $this->healthStatusHandlerId . ' AND personId=' . $this->personId);
return;
}
parent::persist();
}
示例7: persist
public function persist()
{
if (!$this->dateTime || $this->dateTime == '0000-00-00 00:00:00') {
$this->dateTime = date('Y-m-d H:i:s');
}
if (!$this->patientProcedureId > 0) {
$this->populateVisitDiagnoses();
}
return parent::persist();
}
示例8: persist
public function persist()
{
if ($this->_ormPersist) {
return parent::persist();
}
if ($this->shouldAudit()) {
$sql = $this->toSQL();
AuditLog::appendSql($sql);
}
}
示例9: persist
/**
* Overrides WebVista_Model_ORM::persist()
*/
public function persist()
{
$order = (int) $this->order;
if (!$order > 0 && $this->_persistMode != WebVista_Model_ORM::DELETE) {
$db = Zend_Registry::get("dbAdapter");
$dbSelect = $db->select()->from($this->_table, "MAX(`order`) AS order");
$result = $db->fetchRow($dbSelect);
$this->order = $result['order'] + 1;
}
parent::persist();
}
示例10: persist
public function persist()
{
parent::persist();
$storageString = new StorageString();
$storageString->setPersistMode($this->_persistMode);
$storageString->foreignKey = $this->companyId;
$storageString->valueKey = 'email';
$storageString->value = $this->_companyEmail;
$storageString->arrayIndex = 1;
// start index at 1, may have problem with ORM
$storageString->persist();
}
示例11: persist
public function persist()
{
$filename = $this->getUploadFilename();
$version = (int) $this->version;
if ($version <= 0) {
$this->version = $this->getLatestVersion() + 1;
}
$ret = parent::persist();
if ($ret && $this->_persistMode == self::DELETE && file_exists($filename)) {
unlink($filename);
}
return $ret;
}
示例12: persist
public function persist()
{
$cascadePersist = null;
if (!$this->numberId > 0) {
$this->number->persist();
$this->numberId = $this->number->numberId;
$cascadePersist = $this->number->_cascadePersist;
$this->number->_cascadePersist = false;
}
parent::persist();
if ($cascadePersist !== null) {
$this->number->_cascadePersist = $cascadePersist;
}
}
示例13: persist
public function persist()
{
$ret = parent::persist();
if ($this->_persistMode !== WebVista_Model_ORM::DELETE) {
return $ret;
}
$method = new NSDRDefinitionMethod();
$methodIterator = $method->getIteratorByParentId($this->uuid);
$methods = $methodIterator->toArray('uuid', 'uuid');
foreach ($methods as $key => $val) {
$item = clone $method;
$item->uuid = $key;
$item->setPersistMode($this->_persistMode);
$item->persist();
}
return $ret;
}
示例14: persist
public function persist()
{
if ($this->_persistMode === WebVista_Model_ORM::DELETE) {
$db = Zend_Registry::get('dbAdapter');
$sql = $this->toSQL();
$code = preg_replace('/[^a-z_0-9- \\.]/i', '', $this->code);
$sql .= " AND `code` = '{$code}'";
$db->query($sql);
$this->postPersist();
if ($this->shouldAudit()) {
WebVista_Model_ORM::audit($this);
}
} else {
parent::persist();
}
return $this;
}
示例15: persist
public function persist()
{
if ($this->_persistMode == WebVista_Model_ORM::DELETE) {
return parent::persist();
}
$db = Zend_Registry::get('dbAdapter');
$clinicalNoteTemplateId = (int) $this->clinicalNoteTemplateId;
$data = $this->toArray();
if ($clinicalNoteTemplateId > 0) {
$ret = $db->update($this->_table, $data, 'clinicalNoteTemplateId = ' . $clinicalNoteTemplateId);
} else {
$this->clinicalNoteTemplateId = WebVista_Model_ORM::nextSequenceId();
$data['clinicalNoteTemplateId'] = $this->clinicalNoteTemplateId;
$ret = $db->insert($this->_table, $data);
}
return $this;
}