2017 © Pedro Peláez
 

library hypersistence-alpha

PHP Object Oriented persistence framework.

image

mateusfornari/hypersistence-alpha

PHP Object Oriented persistence framework.

  • Monday, September 11, 2017
  • by mateusfornari
  • Repository
  • 3 Watchers
  • 5 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Hypersistence2.0

PHP Object Orented persistence framework., (*1)


Use doc comment tags for mapping classes with database., (*2)

Example:


/** * @table(person) */ class Person extends Hypersistence{ /** * @primaryKey * @column(person_id) */ private $id; /** * Use empty column when the column has the same name that var. * @column() */ private $name; /** * When you have a Many to One relationship use tags as below. * You can use 'lazy' or 'eager'. * @manyToOne(lazy) * @column(city_id) * @itemClass(City) */ private $city; /** * When you have a One to Many relationship use tags as below. * You can use 'lazy' or 'eager'. * @oneToMany(lazy) * @joinColumn(person_id) * @itemClass(Book) */ private $books; /** * When you have a Many to Many relationship use tags as below. * You can use 'lazy' or 'eager'. * @manyToMany(lazy) * @joinColumn(person_id) * @inverseJoinColumn(course_id) * @itemClass(Course) * @joinTable(person_has_course) */ private $courses; public function getId(){ return $this->id; } public function setId($id){ $this->id = $id; } public function getName(){ return $this->name; } public function setName($name){ $this->name = $name; } public function getCity(){ return $this->city; } public function setCity($city){ $this->city = $city; } public function getBooks(){ return $this->books; } public function getCourses(){ return $this->courses; } }

Load Example:


$p = new Person(); $p->setId(1); $p->load(); echo $p->getName();

Save Example:


$p = new Person(); $p->setName('Mateus Fornari'); $city = new City(1); $city->load(); $p->setCity($city); $p->save();

Search Example:


$p = new Person(); $p->setName('Mateus'); $search = $p->search(); $search->orderBy('name', 'asc'); $search->orderBy('city.name', 'desc'); $list = $search->execute();

The Versions

11/09 2017

dev-master

9999999-dev http://github.com/mateusfornari/hypersistence-alpha

PHP Object Oriented persistence framework.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

framework microframework persistence

11/09 2017

v1.2-alpha

1.2.0.0-alpha http://github.com/mateusfornari/hypersistence-alpha

PHP Object Oriented persistence framework.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

framework microframework persistence

09/09 2017

v1.1

1.1.0.0 http://github.com/mateusfornari/hypersistence-alpha

PHP Object Oriented persistence framework.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

framework microframework persistence