array2object($dataArray); $classCall = null; $classCall = RequestFactory::build($dataObject->func, $format, $dataObject); return $classCall; } /** * Method to convert Array -> Object -> Array. * * @param hash $data Containing array object * * @return stdClass Object $object Containing stdClass object * * @since 3.4 */ public function array2object($data) { if (is_array($data)) { $data = json_decode(json_encode($data)); } return $data; } public function convertArray2Formatted($type = '', $data = '') { $resultString = ''; if ($type == 'json') { $resultString = json_encode($data); } if ($type == 'yaml') { $resultString = Spyc::YAMLDump($data); } return $resultString; } public function convertFormatted2array($type = '', $data = '') { $resultArray = ''; if ($type == 'json') { $resultArray = json_decode($data, true); } if ($type == 'yaml') { $resultArray = Spyc::YAMLLoad($data); } return $resultArray; } public function array_filter_recursive($input) { foreach ($input as &$value) { if (is_array($value)) { $value = $this->array_filter_recursive($value); } } return array_filter($input); } }