public static function FromJSON($json) { if (function_exists('json_dencode')) { return json_dencode($json); } else { $jsonConverter = new Services_JSON(); return $jsonConverter->decode($json); } }
/** * This will create a document from the supplied json string. * WARNING: the constructor of the document will not be called. * * @param string $data * @param \Doctrine\ODM\MongoDB\DocumentManager $documentManager * @param string $className * @return object */ public function fromJson($data, $className = null, $mode = self::UNSERIALIZE_PATCH, $document = null) { return $this->unserialize(json_dencode($data), $className, $mode, $document); }