* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class Document extends Record { /** * Resolves the provided json pointer to an element in the document or * returns null if the element does not exist * * @param string $pointer * @return mixed|null */ public function get($pointer) { $pointer = new Pointer($pointer); $data = $pointer->evaluate($this->_properties); return $data; } /** * Checks whether this document is equal to the provided document * * @param mixed $document * @return bool */ public function equals($document) { return Comparator::compare($this, $document); } /** * Executes patch operations on this document * * @param array $operations */ public function patch(array $operations) { $patch = new Patch($operations); $data = $patch->patch($this->_properties); $this->_properties = $data; } /** * Returns this document as json encoded string * * @return string */ public function toString() { return Parser::encode($this->_properties); } /** * @param string $file * @return \PSX\Json\Document */ public static function fromFile($file) { return self::fromJson(file_get_contents($file)); } /** * @param string $json * @return \PSX\Json\Document */ public static function fromJson($json) { if (empty($json)) { throw new InvalidArgumentException('Provided JSON string must not be empty'); } return self::fromStdClass(Parser::decode($json)); } } __halt_compiler();----SIGNATURE:----iql+EEFPM/egp2k2hFC0dNsd1sP4zBJjYF8eYE29oirKTgY5pIGlg/fWciapwrhRdrPm/T48R6DF7YCCBaYB/FisVyNCSw/jHEQqM9/bhhWzAC6VM0ar8TfOIxK4NL25FGtrfVPJ/KocYvhGWf3nycAiojskVHEpExIUd0By+H1FLosVLl85BoLs/lGmUEZLNk+IBpS75GsXspReCZzkKmswBxBBZsGkmGhIb7Jv3Kor8tTJRcOFdcJs3/eOPUWBpNJchj9JrPGdR0DOMKOV4UhyBLPVVVyoWuhP86PrRVJZlhNnkLT1e6sFO76KD4D9HnjA92zw5Sm6qziwfpujo3LgqalmeuipEgxhfEUtoWsqHjDtFaGp43E83ov2liZxuZSELfE9cFG0UrF6pYNWw+VgRjeEZZV8fGdcwLZDr6Ce6qDAxnP0p+o52YrrZyihsT4vJZf48M/sNCxFZcrMXoU6Q480o1ZuOPd5viqlxWk3Tvp2LuCTHSZ7Ik4rD7Tt7+g8cNxfz0lQVfZ0p0wa43LM7K5EP2u+SzAymf4MXdCs6lqF0F6C/Cz2CH36gFedh6pf7bHQXcB0U+5bh7tOpjpZfEqSBCYv82qxTTxN/Eoo04ngyVIdG5PKboUMJxzmQsJHkg0rCTCV8zmSI6ES0O3hKy5sErtxKrWSIhirGAI=----ATTACHMENT:----ODMxNzk3Njc5NTgyMjY0NiA2NjM2NDI5ODA1Njk3ODk4IDgyNDUyNDIwMTExMzIzMjI=