Merged in 3.1 (pull request #4450)

Updating branch with changes to 2016-06-23 11:35
This commit is contained in:
Julio Cesar Laura Avendaño
2016-06-23 11:17:01 -04:00
7 changed files with 315 additions and 137 deletions

View File

@@ -136,5 +136,23 @@ class Common extends \Maveriks\Util\Common
return $sCode;
}
/**
* Convert string to JSON
*
* @param string $string
*
* @return object Returns an object, FALSE otherwise
*/
public static function stringToJson($string)
{
try {
$object = json_decode($string);
return (json_last_error() == JSON_ERROR_NONE)? $object : false;
} catch (\Exception $e) {
throw $e;
}
}
}