Download the PHP package lox/pheasant without Composer
On this page you can find all versions of the php package lox/pheasant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package pheasant
Short Description A lightweight data mapper for MySQL and PHP 5.3+
License MIT
Informations about the package pheasant
Pheasant
Pheasant is an object relational mapper written to take advantage of PHP 7. Simple relationships are supported, with the emphasis being on scalability and performance over complexity.
Pheasant doesn't attempt to abstract the database and makes heavy use of MySQL/Innodb features.
Status of Development
Running in production on 99designs.com. See ROADMAP
for more details on future plans.
Installing
Easiest way is to install via composer http://packagist.org/packages/lox/pheasant.
Persisting Objects
Each domain object has a set of properties and relationships that are defined in the configure method. Each domain object delegates to a mapper object for the actual saving and loading of objects.
Magical Finders
Many variations of finders are available for locating objects:
Collection Scoping
Scoping allows you to specify commonly-used queries which can be referenced as method calls on Collection objects. All scope methods will return a Pheasant::Collection object which will allow for further methods (such as other scopes) to be called on it.
To define a simple scope, we first define a scopes
method in our DomainObject
that returns an associative array in "methodName" => $closure
form.
Events
Code can be triggered before and after create, update and delete operations.
Optionally, domain objects provide the following implicit hooks which can be overriden:
- afterCreate
- beforeUpdate, afterUpdate
Transactions
Transactions can be created globally:
Or transactions can be invoked on an instance:
Contributors
Many thanks to @dhotson, @michaeldewildt, @rbone, @harto, @jorisleker, @tombb, @Jud, @bjornpost, @creativej