array( 'name' => 'time', 'required' => true, 'type' => \ProtobufMessage::PB_TYPE_INT, ), self::CONTENTS => array( 'name' => 'contents', 'repeated' => true, 'type' => 'Log_Content' ), ); /** * Constructs new message container and clears its internal state */ public function __construct() { $this->reset(); } /** * Clears message values and sets default ones * * @return null */ public function reset() { $this->values[self::TIME] = null; $this->values[self::CONTENTS] = array(); } /** * Returns field descriptors * * @return array */ public function fields() { return self::$fields; } /** * Sets value of 'time' property * * @param integer $value Property value * * @return null */ public function setTime($value) { return $this->set(self::TIME, $value); } /** * Returns value of 'time' property * * @return integer */ public function getTime() { $value = $this->get(self::TIME); return $value === null ? (integer)$value : $value; } /** * Appends value to 'contents' list * * @param Log_Content $value Value to append * * @return null */ public function appendContents(Log_Content $value) { return $this->append(self::CONTENTS, $value); } /** * Clears 'contents' list * * @return null */ public function clearContents() { return $this->clear(self::CONTENTS); } /** * Returns 'contents' list * * @return Log_Content[] */ public function getContents() { return $this->get(self::CONTENTS); } /** * Returns 'contents' iterator * * @return \ArrayIterator */ public function getContentsIterator() { return new \ArrayIterator($this->get(self::CONTENTS)); } /** * Returns element from 'contents' list at given offset * * @param int $offset Position in list * * @return Log_Content */ public function getContentsAt($offset) { return $this->get(self::CONTENTS, $offset); } /** * Returns count of 'contents' list * * @return int */ public function getContentsCount() { return $this->count(self::CONTENTS); } }