1
0
mirror of synced 2024-11-30 09:16:06 +03:00
bitrix-module/intaro.retailcrm/classes/general/Model/BaseModel.php
Neur0toxine 09f82bcfdf
Customer change
* remove useless request for history
* append new address to corporate customer
* centralized configuration provider
* use companyName filter in event & pass companyName into order
* add AdressBuilder* fixed for regressions
* fixed double contact problem
2020-07-14 13:47:26 +03:00

39 lines
687 B
PHP

<?php
/**
* Class BaseModel
*/
abstract class BaseModel
{
/**
* @return array
*/
public function getObjectToArray()
{
return $this->arrayClear(call_user_func('get_object_vars', $this));
}
/**
* @param array $array
* @param array $symbols
* @return array
*/
public function arrayClear(array $array, array $symbols = array('', 0, null))
{
return array_diff($array, $symbols);
}
/**
* @param $array
* @return $this
*/
public function getArrayToObject($array)
{
foreach ($array as $key => $value) {
$this->$key = $value;
}
return $this;
}
}