2012-01-22 13:35:06 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\ORM\Tools\Pagination;
|
|
|
|
|
|
|
|
use Doctrine\Tests\OrmTestCase;
|
|
|
|
|
|
|
|
abstract class PaginationTestCase extends OrmTestCase
|
|
|
|
{
|
2014-12-05 14:55:56 +01:00
|
|
|
/**
|
|
|
|
* @var \Doctrine\ORM\EntityManagerInterface
|
|
|
|
*/
|
2012-01-22 13:35:06 +01:00
|
|
|
public $entityManager;
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->entityManager = $this->_getTestEntityManager();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class MyBlogPost
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
/**
|
|
|
|
* @ManyToOne(targetEntity="Author")
|
|
|
|
*/
|
|
|
|
public $author;
|
|
|
|
/**
|
|
|
|
* @ManyToOne(targetEntity="Category")
|
|
|
|
*/
|
|
|
|
public $category;
|
2012-09-18 13:56:32 +02:00
|
|
|
/** @column(type="string") */
|
|
|
|
public $title;
|
2012-01-22 13:35:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class MyAuthor
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class MyCategory
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class BlogPost
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
/**
|
|
|
|
* @ManyToOne(targetEntity="Author")
|
|
|
|
*/
|
|
|
|
public $author;
|
|
|
|
/**
|
|
|
|
* @ManyToOne(targetEntity="Category")
|
|
|
|
*/
|
|
|
|
public $category;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class Author
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
/** @Column(type="string") */
|
|
|
|
public $name;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class Person
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
/** @Column(type="string") */
|
|
|
|
public $name;
|
|
|
|
/** @Column(type="string") */
|
|
|
|
public $biography;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class Category
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** @Entity @Table(name="groups") */
|
|
|
|
class Group
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
/** @ManyToMany(targetEntity="User", mappedBy="groups") */
|
|
|
|
public $users;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @Entity */
|
|
|
|
class User
|
|
|
|
{
|
|
|
|
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
/**
|
|
|
|
* @ManyToMany(targetEntity="Group", inversedBy="users")
|
|
|
|
* @JoinTable(
|
|
|
|
* name="user_group",
|
|
|
|
* joinColumns = {@JoinColumn(name="user_id", referencedColumnName="id")},
|
|
|
|
* inverseJoinColumns = {@JoinColumn(name="group_id", referencedColumnName="id")}
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public $groups;
|
|
|
|
}
|
2014-12-16 11:59:13 -05:00
|
|
|
|
|
|
|
/** @Entity */
|
|
|
|
class Avatar
|
|
|
|
{
|
|
|
|
/** @Id @column(type="integer") @generatedValue */
|
|
|
|
public $id;
|
|
|
|
/**
|
|
|
|
* @OneToOne(targetEntity="User", inversedBy="avatar")
|
|
|
|
* @JoinColumn(name="user_id", referencedColumnName="id")
|
|
|
|
*/
|
|
|
|
public $user;
|
|
|
|
/** @column(type="string", length=255) */
|
|
|
|
public $image;
|
|
|
|
/** @column(type="integer") */
|
|
|
|
public $image_height;
|
|
|
|
/** @column(type="integer") */
|
|
|
|
public $image_width;
|
2014-12-17 16:00:43 -05:00
|
|
|
/** @column(type="string", length=255) */
|
|
|
|
public $image_alt_desc;
|
2014-12-16 11:59:13 -05:00
|
|
|
}
|