Skip to content
Katana ORM, the new incredible sharp PHP ORM - maybe someday.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Katana ORM

Katana ORM is a fork of the glory Propel ORM but with some fundamental changes.

  • UnitOfWork - allows mass insertion/update and separation of repository and entity
  • Optional ActiveRecord
  • JIT Compiler - instead of having a build time it can create the needed stuff on the fly
  • JIT Migration - instead of manually migrate your database we do it for you if needed automatically
  • NoSQL adapter - in the first version some basic support for some noSQL databases
  • Better/Easier “behavior” development (plugins)
  • Entity definition through xml, yml, php, database schema, annotations
  • Removed hard dependencies on SQL databases
  • With a REST API Adapter

That all with Propel’s initial blazing fast approach of compiling instead of doing always a database/object introspection, means it will be incredibly fast.


All following steps can be done without having a external build-time (console command executions).


# bootstrap
Katana::setDefaultRepository('mysql', 'localhost', 'root', 'myHeavyPassword');

# example
class Author {
    use Author\ObjectEncapsulation;
    use Author\ActiveRecord;

     * @Field(type="string")
    protected $name;

$author = new Author();
$author->setName('Hans Zimmer');

Nothing else to do for you. What we do in the background: migrate database' schema and build all necessary traits.


Working with already existing table.

class Author {
    use Author\Reverse;
    use Author\ObjectEncapsulation;
    use Author\ActiveRecord;

    protected $repositoryContainer = 'authors';

$author = AuthorQuery::create()->findOneByName('Hans Zi');
$author->setName('Hans Zimmer');

Centralized definition


        adapter: mysql
        host: localhost
        user: root
        password: myHeavyPassword


    repository: default
    active_record: false
        name: string
        points: integer

$authors = Namespaced\AuthorQuery::create()->find();
foreach ($authors as $author) {

Katana::getRepository()->flush(); // writes all changes at once
Something went wrong with that request. Please try again.