PHP Classes

File: tests/Model/BlogUser.php

Recommend this page to a friend!
  Classes of Maik Greubel   Caribu ORM   tests/Model/BlogUser.php   Download  
File: tests/Model/BlogUser.php
Role: Unit test script
Content type: text/plain
Description: Referenced entity test model
Class: Caribu ORM
Map objects to databases records using annotations
Author: By
Last change: Strong type and documentation fixes
Date: 7 years ago
Size: 1,823 bytes
 

Contents

Class file image Download
<?php
namespace Nkey\Caribu\Tests\Model;

use
Nkey\Caribu\Model\AbstractModel;

/**
 * Annotated user model
 *
 * This class is part of Caribu package
 *
 * @author Maik Greubel <greubel@nkey.de>
 *
 * @table user
 * @entity
 */
class BlogUser extends AbstractModel
{

   
/**
     * @id
     * @column id
     *
     * @var int
     */
   
private $userId;

   
/**
     *
     * @var string
     */
   
private $name;

   
/**
     *
     * @var string
     */
   
private $email;

   
/**
     * The blog posts, the user owns
     *
     * @mappedBy(table=blog_user_to_posts,column=postid,inverseColumn=userid)
     *
     * @var BlogPost[]
     */
   
private $posts;

   
/**
     *
     * @return int
     */
   
public function getUserId()
    {
        return
$this->userId;
    }

   
/**
     *
     * @param
     * $userId
     */
   
public function setUserId($userId)
    {
       
$this->userId = $userId;
        return
$this;
    }

   
/**
     *
     * @return string
     */
   
public function getName()
    {
        return
$this->name;
    }

   
/**
     *
     * @param
     * $name
     */
   
public function setName($name)
    {
       
$this->name = $name;
        return
$this;
    }

   
/**
     *
     * @return string
     */
   
public function getEmail()
    {
        return
$this->email;
    }

   
/**
     *
     * @param
     * $email
     */
   
public function setEmail($email)
    {
       
$this->email = $email;
        return
$this;
    }

   
/**
     *
     * @return BlogPost[]
     */
   
public function getPosts()
    {
        return
$this->posts;
    }

   
/**
     *
     * @param
     * $posts
     */
   
public function setPosts($posts)
    {
       
$this->posts = $posts;
        return
$this;
    }
}