本文整理汇总了PHP中Tinebase_Record_Abstract::setFromArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Record_Abstract::setFromArray方法的具体用法?PHP Tinebase_Record_Abstract::setFromArray怎么用?PHP Tinebase_Record_Abstract::setFromArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Record_Abstract
的用法示例。
在下文中一共展示了Tinebase_Record_Abstract::setFromArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setFromArray
/**
* convert remark to array if json encoded
*
* @see Tinebase_Record_Abstract::setFromArray
*
* @param array $_data the new data to set
*
* @todo always json::encode remarks? / add options field that is always json encoded
*/
public function setFromArray(array $_data)
{
parent::setFromArray($_data);
if ($this->remark && is_string($this->remark) && strpos($this->remark, '{') === 0) {
$this->remark = Zend_Json::decode($this->remark);
}
}
示例2: setFromArray
public function setFromArray(array $_data)
{
if (empty($_data['termination_date']) || $_data['termination_date'] == "") {
unset($_data['termination_date']);
}
parent::setFromArray($_data);
}
示例3: setFromArray
/**
* (non-PHPdoc)
* @see tine20/Tinebase/Record/Abstract::setFromArray()
*/
public function setFromArray(array $_data)
{
if (isset($_data['records']) && is_array($_data['records'])) {
$_data['records'] = new Tinebase_Record_RecordSet($this->_keyFieldRecordModel, $_data['records'], TRUE);
}
parent::setFromArray($_data);
}
示例4: setFromArray
/**
* (non-PHPdoc)
* @see Tinebase/Record/Tinebase_Record_Abstract#setFromArray($_data)
*/
public function setFromArray(array $_data)
{
parent::setFromArray($_data);
// always set url here (or is there a better place?)
if ($this->getId()) {
$this->url = $this->getDownloadUrl();
}
}
示例5: setFromArray
/**
* (non-PHPdoc)
* @see Tinebase/Record/Tinebase_Record_Abstract#setFromArray($_data)
*/
public function setFromArray(array $_data)
{
parent::setFromArray($_data);
// always set url here (or is there a better place?)
if ($this->getId()) {
$this->url = Tinebase_Core::getHostname() . '/download/show/' . $this->getId();
}
}
示例6: setFromArray
/**
* sets the record related properties from user generated input.
*
* Input-filtering and validation by Zend_Filter_Input can enabled and disabled
*
* @param array $_data the new data to set
*/
public function setFromArray(array $_data)
{
foreach (array('emailForwards', 'emailAliases') as $arrayField) {
if (isset($_data[$arrayField]) && !is_array($_data[$arrayField])) {
$_data[$arrayField] = explode(',', preg_replace('/ /', '', $_data[$arrayField]));
}
}
parent::setFromArray($_data);
}
示例7: setFromArray
public function setFromArray(array $_data)
{
if (empty($_data['creditor_id']) || $_data['creditor_id'] == "") {
unset($_data['creditor_id']);
}
if (empty($_data['debitor_id']) || $_data['debitor_id'] == "") {
unset($_data['debitor_id']);
}
parent::setFromArray($_data);
}
示例8: setFromArray
public function setFromArray(array $_data)
{
if (empty($_data['signature_date']) || $_data['signature_date'] == "") {
$_data['signature_date'] = null;
}
if (empty($_data['last_usage_date']) || $_data['last_usage_date'] == "") {
unset($_data['last_usage_date']);
}
parent::setFromArray($_data);
}
示例9: setFromArray
/**
* (non-PHPdoc)
* @see tine20/Tinebase/Record/Abstract.php::setFromArray()
*/
public function setFromArray(array $_data)
{
if (isset($_data['definition']) || array_key_exists('definition', $_data)) {
if (is_string($_data['definition'])) {
$_data['definition'] = Zend_Json::decode($_data['definition']);
}
if (is_array($_data['definition'])) {
$_data['definition'] = new Tinebase_Config_Struct($_data['definition']);
}
}
return parent::setFromArray($_data);
}
示例10: setFromArray
/**
* (non-PHPdoc)
* @see Tinebase_Record_Abstract::setFromArray()
*/
public function setFromArray(array $_data)
{
parent::setFromArray($_data);
// sanitize members (could be an array of user arrays -> expecting to contain only ids)
if (isset($this->members) && is_array($this->members) && count($this->members) > 0 && is_array($this->members[0])) {
$memberIds = array();
foreach ($this->members as $member) {
$memberIds[] = $member['id'];
}
$this->members = $memberIds;
}
}
示例11: setFromArray
public function setFromArray(array $_data)
{
if (empty($_data['fibu_exp_date']) || $_data['fibu_exp_date'] == "") {
unset($_data['fibu_exp_date']);
}
if (empty($_data['banking_exp_date']) || $_data['banking_exp_date'] == "") {
unset($_data['banking_exp_date']);
}
if (empty($_data['last_monition_date']) || $_data['last_monition_date'] == "") {
unset($_data['last_monition_date']);
}
parent::setFromArray($_data);
}
示例12: setFromArray
public function setFromArray(array $_data)
{
if (empty($_data['fibu_exp_date']) || $_data['fibu_exp_date'] == "") {
$_data['fibu_exp_date'] = null;
}
if (empty($_data['order_lock_date']) || $_data['order_lock_date'] == "") {
$_data['order_lock_date'] = null;
}
if (empty($_data['monition_lock_date']) || $_data['monition_lock_date'] == "") {
$_data['monition_lock_date'] = null;
}
parent::setFromArray($_data);
}
示例13: setFromArray
/**
* sets the record related properties from user generated input.
*
* Input-filtering and validation by Zend_Filter_Input can enabled and disabled
*
* @param array $_data the new data to set
*/
public function setFromArray(array $_data)
{
if (isset($_data['filters']) && !$_data['filters'] instanceof Tinebase_Model_Filter_FilterGroup) {
try {
$_data['filters'] = $this->getFilterGroup($_data['model'], $_data['filters']);
} catch (Tinebase_Exception_NotFound $tenf) {
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Sort out missing ' . $_data['model'] . ' filter: ' . $tenf->getMessage());
}
}
}
return parent::setFromArray($_data);
}
示例14: setFromArray
public function setFromArray(array $_data)
{
if (empty($_data['order_nr']) || $_data['order_nr'] == "") {
unset($_data['order_nr']);
}
if (empty($_data['supplier_order_nr']) || $_data['supplier_order_nr'] == "") {
unset($_data['supplier_order_nr']);
}
if (empty($_data['supply_request_nr']) || $_data['supply_request_nr'] == "") {
unset($_data['supply_request_nr']);
}
if (empty($_data['supply_offer_nr']) || $_data['supply_offer_nr'] == "") {
unset($_data['supply_offer_nr']);
}
if (empty($_data['supply_order_nr']) || $_data['supply_order_nr'] == "") {
unset($_data['supply_order_nr']);
}
if (empty($_data['supply_inc_inv_nr']) || $_data['supply_inc_inv_nr'] == "") {
unset($_data['supply_inc_inv_nr']);
}
if (empty($_data['request_date']) || $_data['request_date'] == "") {
unset($_data['request_date']);
}
if (empty($_data['offer_date']) || $_data['offer_date'] == "") {
unset($_data['offer_date']);
}
if (empty($_data['offer_shipping_date']) || $_data['offer_shipping_date'] == "") {
unset($_data['offer_shipping_date']);
}
if (empty($_data['order_shipping_date']) || $_data['order_shipping_date'] == "") {
unset($_data['order_shipping_date']);
}
if (empty($_data['shipping_date']) || $_data['shipping_date'] == "") {
unset($_data['shipping_date']);
}
if (empty($_data['order_confirm_date']) || $_data['order_confirm_date'] == "") {
unset($_data['order_confirm_date']);
}
if (empty($_data['order_date']) || $_data['order_date'] == "") {
unset($_data['order_date']);
}
if (empty($_data['inc_invoice_date']) || $_data['inc_invoice_date'] == "") {
unset($_data['inc_invoice_date']);
}
if (empty($_data['inc_invoice_postal_date']) || $_data['inc_invoice_postal_date'] == "") {
unset($_data['inc_invoice_postal_date']);
}
parent::setFromArray($_data);
}
示例15: setFromArray
public function setFromArray(array $_data)
{
if (empty($_data['article_id']) || $_data['article_id'] == "") {
unset($_data['article_id']);
}
if (empty($_data['order_id']) || $_data['order_id'] == "") {
unset($_data['order_id']);
}
if (empty($_data['weight']) || $_data['weight'] == "") {
$_data['weight'] = 0;
}
if (empty($_data['total_weight']) || $_data['total_weight'] == "") {
$_data['total_weight'] = 0;
}
parent::setFromArray($_data);
}