| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /**
- * Copyright (C) Alibaba Cloud Computing
- * All rights reserved
- */
- /**
- * Aliyun_Log_Models_LogItem used to present a log, it contains log time and multiple
- * key/value pairs to present the log contents.
- *
- * @author log service dev
- */
- class Aliyun_Log_Models_LogItem {
-
- /**
- * @var integer time of the log item, the default time if the now time.
- */
- private $time;
- /**
- * @var array the data of the log item, including many key/value pairs.
- */
- private $contents;
-
- /**
- * Aliyun_Log_Models_LogItem cnostructor
- *
- * @param array $contents
- * the data of the log item, including many key/value pairs.
- * @param integer $time
- * time of the log item, the default time if the now time.
- */
- public function __construct($time = null, $contents = null) {
- if (! $time)
- $time = time ();
- $this->time = $time;
- if ($contents)
- $this->contents = $contents;
- else
- $this->contents = array ();
- }
-
- /**
- * Get log time
- *
- * @return integer log time
- */
- public function getTime() {
- return $this->time;
- }
-
- /**
- * Set log time
- *
- * @param integer $time
- * log time
- */
- public function setTime($time) {
- $this->time = $time;
- }
-
- /**
- * Get log contents
- *
- * @return array log contents
- */
- public function getContents() {
- return $this->contents;
- }
-
- /**
- * Set log contents
- *
- * @param array $contents
- * log contents
- */
- public function setContents($contents) {
- $this->contents = $contents;
- }
-
- /**
- * Add a key/value pair as log content to the log
- *
- * @param string $key
- * log content key
- * @param string $value
- * log content value
- */
- public function pushBack($key, $value) {
- $this->contents [$key] = $value;
- }
- }
|