* @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:----H8Xwe0pWW8RKVQUt5qu8A9hjd8xFfUct6GXyW2w1DRe8a44YaS8PHBWhQ2TiQi49YEgCE20NKb8SZyxedcU0b6p0wXo/LwarPnFpLU0bCXml5Hkd/JijjPRLMACVXio26bv6wE8EbrhWdijDF/PSNT/RNCg30IJBS8ML3zMhWbxESKc4VmQXDZdR1UZBC3lMpDmVBRbaAjHa9qWq94SFiNnoSMXjXLeIrdFrv55e7i2zm0ZYtOn/auNLozuxhqzwvHF7wzNX3Vt4JXGs2xhWwGnnXzZWyqk1xZgoBFyfCyd65y1P6zX9Wkqbw0/w2oDna+xggM4Oukf0mDbr7EU0afwQZ+noMl1vOMRF/BAzHVC2Y2sWdPydmSmxD80WHtBaRkLX3INLDdXhlPRZukyYIUvFsPcZj+7+D2hdLkgMfjUMsFnskzdYKmNlV8tp+vj+i0hNvhvEEkVe1CotTpS0hMZyv6g64/Q57mPNx/WqiDAj7ycHtotIPBggIstzEfKzxX3p5UpdRJkNZ4Ui2OAjdGqZDSrMeeTaYElUEOguK3iEb/ZG+4FdSqWNZTDT0irFlgqD0ztx3YbyJrSyaYeobtTQbX5mhD2RCmfuDZY5moEkPxWharpcxIa3gAwYcuR3AGTp+A7U6E+CBG+fa2rngtC8cS/hs3avquAjHsqfgag=----ATTACHMENT:----MTc0MzU4MjEzMDgzNTY5IDczOTk3Mjk2NjkyNDY1ODMgOTM1MDk3NzAxNzAxNjA2Mw==