Page MenuHomePhabricator (Chris)

Entity.php
No OneTemporary

Authored By
Unknown
Size
778 B
Referenced Files
None
Subscribers
None

Entity.php

<?php
/*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
class Entity
{
public function toJSON()
{
$reflection = new \ReflectionObject($this);
$properties = $reflection->getProperties();
$fields = array();
foreach ($properties as $property) {
$name = $property->getName();
$property->setAccessible(true);
$value = $property->getValue($this);
$fields[$name] = $value;
}
$json = json_encode($fields);
return $json;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 15, 9:12 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
140295
Default Alt Text
Entity.php (778 B)

Event Timeline