public function fromArray($data) {

		if(false === is_array($data)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		$this -> beforeLoad();

		foreach($data as $column => $value) {
			
			$value 	= $this -> convertToDate($value);
			$value 	= $this -> convertJsonToArray($value);
			$col 	= NameConvert :: toCamelcase($column, true);
			$method = 'set' . $col;

			if(true === method_exists($this, $method)) {
				call_user_func_array([$this, $method], [$value]);
			}
			else {
				$this -> addValue($column, $value, $col);
			}
		}

		$this -> afterLoad();

		return $this;
	}
public function fromArray($data) {

		if(false === is_array($data)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		$this -> beforeLoad();

		foreach($data as $column => $value) {
			
			$value 	= $this -> convertToDate($value);
			$value 	= $this -> convertJsonToArray($value);
			$col 	= NameConvert :: toCamelcase($column, true);
			$method = 'set' . $col;

			if(true === method_exists($this, $method)) {
				call_user_func_array([$this, $method], [$value]);
			}
			else {
				$this -> addValue($column, $value, $col);
			}
		}

		$this -> afterLoad();

		return $this;
	}
public function fromArray ( $ data ) { if ( false === is_array ( $ data ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type Array, "%s" given' , __METHOD__ , gettype ( $ data ) ) , E_USER_ERROR ) ; } $ this -> beforeLoad ( ) ; foreach ( $ data as $ column => $ value ) { $ value = $ this -> convertToDate ( $ value ) ; $ value = $ this -> convertJsonToArray ( $ value ) ; $ col = NameConvert :: toCamelcase ( $ column , true ) ; $ method = 'set' . $ col ; if ( true === method_exists ( $ this , $ method ) ) { call_user_func_array ( [ $ this , $ method ] , [ $ value ] ) ; } else { $ this -> addValue ( $ column , $ value , $ col ) ; } } $ this -> afterLoad ( ) ; return $ this ; }
Converts given array to entity data
@param array $data
@return $this
Converts given array to entity data