Skip to content

Instantly share code, notes, and snippets.

@dadamssg
Last active August 29, 2015 13:57
Show Gist options
  • Save dadamssg/9478210 to your computer and use it in GitHub Desktop.
Save dadamssg/9478210 to your computer and use it in GitHub Desktop.
MyCompany\MyProject\CoreBundle\Entity\TestObject:
exclusion_policy: ALL
properties:
id:
expose: true
type: integer
string:
expose: true
createdAt:
access_type: public_method
accessor:
getter: getCreatedAt
setter: setCreatedAt
expose: true
type: DateTime
{
"id": 23,
"string": "testing..."
}
<?php
namespace MyCompany\MyProject\CoreBundle\Entity;
class TestObject
{
protected $id = 23;
protected $string = 'testing...';
protected $createdAt;
public function __construct()
{
return new \DateTime;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
}
public function getId()
{
return $this->id;
}
public function getString()
{
return $this->string;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment