PHP Classes

File: src/Example/Person.php

Recommend this page to a friend!
  Packages of Mateus Fornari   Hypersistence   src/Example/Person.php   Download  
File: src/Example/Person.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Hypersistence
Store and retrieve objects in databases using PDO
Author: By
Last change:
Date: 12 years ago
Size: 988 bytes
 

 

Contents

Class file image Download
<?php

/**
 * @table(person)
 */
class Person extends Hypersistence{
    
    /**
     * @primaryKey 
     */
    protected $id;
    /**
     * @column() 
     */
    protected $name;
    /**
     * @column() 
     */
    protected $email;
    
    /**
     * @manyToOne(lazy)
     * @itemClass(City)
     * @column(city_id) 
     */
    protected $city;


    /**
     * @oneToMany(lazy)
     * @itemClass(Book)
     * @joinColumn(person_id) 
     */
    protected $books;
    
    
    public function getId() {
        return $this->id;
    }

    public function getName() {
        return $this->name;
    }

    public function getEmail() {
        return $this->email;
    }

    public function getBooks() {
        return $this->books;
    }
    
    public function setBooks($books) {
        $this->books = $books;
    }

    public function setId($id) {
        $this->id = $id;
    }

    public function setName($name) {
        $this->name = $name;
    }

    public function setEmail($email) {
        $this->email = $email;
    }

    public function getCity() {
        return $this->city;
    }

    public function setCity($city) {
        $this->city = $city;
    }



}