getObjectFromSql('select * from packet_ogn where id = ?', [$id]); else return $this->getObjectFromSql('select * from packet_ogn where id = ? and timestamp = ?', [$id, $timestamp]); } /** * Get object by packet id * * @param int $id * @param int $timestamp (optional timestamp which is used by query planner to optimize the query) * @return PacketOgn */ public function getObjectByPacketId($packetId, $timestamp=null) { if (!isInt($packetId) || (!is_null($timestamp) && !isInt($timestamp))) { return new PacketOgn(0); } if (is_null($timestamp)) return $this->getObjectFromSql('select * from packet_ogn where packet_id = ?', [$packetId]); else return $this->getObjectFromSql('select * from packet_ogn where packet_id = ? and timestamp = ?', [$packetId, $timestamp]); } }