| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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;
- }
- }
|