Skip to content

Instantly share code, notes, and snippets.

@mattsches

mattsches/Album.php

Created Apr 24, 2016
Embed
What would you like to do?
Example entity for DoctrineRestDriver issue
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* This annotation marks the class as managed entity:
*
* @ORM\Entity
*
* You can either only use a resource name or the whole url of
* the resource to define your target. In the first case the target
* url will consist of the host, configured in your options and the
* given name. In the second one your argument is used as it is.
* Important: The resource name must begin with its protocol.
*
* @ORM\Table("http://jsonplaceholder.typicode.com/albums")
*/
class Album
{
/**
* @var int
*
* @ORM\Column(name="userId", type="integer")
*/
private $userId;
/**
* @var int
*
* @ORM\Column(type="integer")
* @ORM\Id
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=100)
*/
private $title;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param string $title
*
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @return int
*/
public function getUserId()
{
return $this->userId;
}
/**
* @param int $userId
*
* @return $this
*/
public function setUserId($userId)
{
$this->userId = $userId;
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment