本文整理汇总了PHP中CMbObject::nullifyEmptyFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbObject::nullifyEmptyFields方法的具体用法?PHP CMbObject::nullifyEmptyFields怎么用?PHP CMbObject::nullifyEmptyFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbObject
的用法示例。
在下文中一共展示了CMbObject::nullifyEmptyFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bindObject
/**
* Binds the idex to an object, and updates the object
* Will only bind default object properties when it's created
*
* @param CMbObject &$mbObject Object
* @param CMbObject $mbObjectDefault Default object
*
* @throws Exception
*
* @return void
*/
function bindObject(&$mbObject, $mbObjectDefault = null)
{
$object_class = get_class($mbObject);
if (!$mbObject instanceof CMbObject) {
trigger_error("Impossible d'associer un identifiant Santé 400 à un objet de classe '{$object_class}'");
}
$this->object_class = $object_class;
$this->object_id = $mbObject->_id;
$this->last_update = null;
// In case already defined
$this->loadMatchingObject();
$this->_ref_object = null;
// Prevent optimisation errors
$this->loadRefs();
// Object has not been found : never created or deleted since last binding
if (!@$this->_ref_object->_id && $mbObjectDefault) {
$mbObjectDefault->nullifyEmptyFields();
$mbObject->extendsWith($mbObjectDefault);
}
// Create/update bound object
$mbObject->_id = $this->object_id;
$mbObject->updatePlainFields();
$mbObject->repair();
if ($msg = $mbObject->store()) {
throw new Exception($msg);
}
$this->object_id = $mbObject->_id;
$this->last_update = CMbDT::dateTime();
// Create/update the idSante400
if ($msg = $this->store()) {
throw new Exception($msg);
}
}