2017 © Pedro PelĂĄez
 

library orm

Extension Nextras/ORM

image

nattreid/orm

Extension Nextras/ORM

  • Monday, March 5, 2018
  • by attreid
  • Repository
  • 1 Watchers
  • 0 Stars
  • 242 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 72 Versions
  • 3 % Grown

The README.md

Rozơíƙení Nextras/ORM

NastavenĂ­ config.neon, (*1)

extensions:
    dbal: Nextras\Dbal\Bridges\NetteDI\DbalExtension
    orm: NAttreid\Orm\DI\OrmExtension

dbal:
    dbal:
    driver: mysqli
    host: 127.0.0.1
    database: test
    username: test
    password: test

orm:
    model: App\Model\Orm
    useCamelCase: true
    autoManageDb: true # automaticka kontrola tabulek a vytvareni neexistujicich
    add:
        - Another\Orm

Model

namespace App\Model;

/**
 * @property-read ExampleRepository $example
 */
class Orm extends \Nextras\Orm\Model\Model {

}

Repository

class ExampleRepository extends \NAttreid\Orm\Repository {

    public static function getEntityClassNames() {
        return [Example::class];
    }
}

Mapper

class ExampleMapper extends \NAttreid\Orm\Mapper {

    protected function createTable(\NAttreid\Orm\Structure\Table $table) {
        $table->setDefaultDataFile(__DIR__.'/import.sql');

        $table->addPrimaryKey('id')
                ->int()
                ->setAutoIncrement();
        $table->addForeignKey('someId', SomeMapper::class);
        $table->addForeignKey('parentId', $table)
                ->setDefault(NULL);
        $table->addColumn('pa')
                ->varChar(20);
        $table->addColumn('allowed')
                ->boolean()
                ->setDefault(1)
                ->setKey();
        $table->addUnique('someId', 'parentId');
        $table->addFulltext('pa');

        $relationTable = $table->createRelationTable(OtherMapper::class);
        $relationTable->addForeignKey('exampleId', $table);
        $relationTable->addForeignKey('otherId', OtherMapper::class);
        $relationTable->setPrimaryKey('exampleId', 'otherId');

        // migrace 
        if (!$relationTable->exists) {
            $table->migration[] = function (Row $row, Connection $connection) use ($relationTable) {
                if (isset($row->oldColumnId)) {
                    $connection->query('INSERT INTO %table %values', $relationTable->name, [
                        'exampleId' => $row->id,
                        'otherId' => $row->oldColumnId
                    ]);
                }
            };
        }

        $this->onCreateTable[] = function () {
            $this->insert([
                [
                    'id' => 1,
                    'someId' => 1,
                    'parentId' => 1,
                    'pa' => 'test',
                    // ...
                ]
            ]);
        };
    }
}

Entity

/**
 * @property int $id {primary}
 * @property Some $some {m:1 Some, oneSided=true}
 * @property Example|NULL $parent {m:1 Example::$children}
 * @property OneHasMany|Example[] $children {1:m Example::$parent, orderBy=id}
 * @property string $pa
 * @property boolean $allowed {default TRUE}
 */
class Example extends \Nextras\Orm\Entity\Entity {

}

Dokumentace na adrese https://nextras.org/orm, (*2)

The Versions

05/03 2018

dev-master

9999999-dev

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

05/03 2018

1.8.1

1.8.1.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

22/02 2018

1.8.0

1.8.0.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

22/02 2018

dev-orm_v_3

dev-orm_v_3

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

21/02 2018

1.7.6

1.7.6.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

24/01 2018

1.7.5

1.7.5.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

24/01 2018

1.7.4

1.7.4.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

24/01 2018

dev-master_

dev-master_

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

24/01 2018

1.7.3

1.7.3.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

02/01 2018

1.7.2

1.7.2.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

27/12 2017

1.7.1

1.7.1.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

11/12 2017

1.7.0

1.7.0.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

05/12 2017

1.6.13

1.6.13.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

05/12 2017

1.6.12

1.6.12.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

05/12 2017

1.6.11

1.6.11.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

29/11 2017

1.6.10

1.6.10.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

16/10 2017

1.6.9

1.6.9.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

11/10 2017

1.6.8

1.6.8.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

26/09 2017

1.6.7

1.6.7.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

26/09 2017

1.6.6

1.6.6.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

14/09 2017

1.6.5

1.6.5.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

17/08 2017

1.6.4

1.6.4.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

26/04 2017

1.6.3

1.6.3.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

25/04 2017

1.6.2

1.6.2.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

25/04 2017

1.6.1

1.6.1.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

19/04 2017

1.6.0

1.6.0.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

23/03 2017

1.5.12

1.5.12.0

Extension Nextras/ORM

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

23/03 2017

1.5.11

1.5.11.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

16/03 2017

1.5.10

1.5.10.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

07/03 2017

1.5.9

1.5.9.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

07/03 2017

1.5.8

1.5.8.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

02/03 2017

1.5.7

1.5.7.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

02/03 2017

1.5.6

1.5.6.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

01/03 2017

1.5.5

1.5.5.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

01/03 2017

1.5.4

1.5.4.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

28/02 2017

1.5.3

1.5.3.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

28/01 2017

1.5.2

1.5.2.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

20/01 2017

1.5.1

1.5.1.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

20/01 2017

1.5.0

1.5.0.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

19/01 2017

1.4.0

1.4.0.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

19/01 2017

1.3.6

1.3.6.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

19/01 2017

1.3.5

1.3.5.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

19/01 2017

1.3.4

1.3.4.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

09/12 2016

1.3.3

1.3.3.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

05/12 2016

1.3.2

1.3.2.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

28/11 2016

1.3.1

1.3.1.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

25/11 2016

1.3.0

1.3.0.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

21/11 2016

1.2.7

1.2.7.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

14/11 2016

1.2.6

1.2.6.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

04/11 2016

1.2.5

1.2.5.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

04/11 2016

1.2.4

1.2.4.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

04/11 2016

1.2.3

1.2.3.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

04/11 2016

1.2.2

1.2.2.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

02/11 2016

1.2.1

1.2.1.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

31/10 2016

1.2.0

1.2.0.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

25/10 2016

1.1.1

1.1.1.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

25/10 2016

1.1.0

1.1.0.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

03/10 2016

1.0.13

1.0.13.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

27/09 2016

1.0.12

1.0.12.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

26/09 2016

1.0.11

1.0.11.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

26/09 2016

1.0.10

1.0.10.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

26/09 2016

1.0.9

1.0.9.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

21/09 2016

1.0.8

1.0.8.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

16/09 2016

1.0.7

1.0.7.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

13/09 2016

1.0.6

1.0.6.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

06/09 2016

1.0.5

1.0.5.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

24/08 2016

1.0.4.1

1.0.4.1

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

04/08 2016

1.0.4

1.0.4.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

04/08 2016

1.0.3

1.0.3.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

03/08 2016

1.0.2

1.0.2.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

03/08 2016

1.0.1

1.0.1.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid

03/08 2016

1.0.0

1.0.0.0

Extension Nextras/ORM

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Avatar attreid