5 * @author Galen Grover <galenjr@gmail.com>
6 * @license http://opensource.org/licenses/mit-license.php The MIT License
16 * @see \Instagram\CurrentUser::addMediaComment()
17 * @see \Instagram\CurrentUser::deleteMediaComment()
18 * @see \Instagram\Media::getCaption()
19 * @see \Instagram\Media::getComments()
21 class Comment extends \Instagram\Core\BaseObjectAbstract {
26 * @var \Instagram\User
28 protected $user = null;
31 * Get comment creation time
33 * @param $format Time format {@link http://php.net/manual/en/function.date.php}
34 * @return string Returns the creation time with optional formatting
37 public function getCreatedTime( $format = null ) {
39 $date = date( $format, $this->data->created_time );
42 $date = $this->data->created_time;
48 * Get the comment text
53 public function getText() {
54 return $this->data->text;
58 * Get the comment's user
61 * @return \Instagram\User
63 public function getUser() {
65 $this->user = new User( $this->data->from, $this->proxy );
71 * Magic toString method
73 * Return the comment text
78 public function __toString() {
79 return $this->getText();