PHP code example of mnapoli / metamodel

1. Go to this page and download the library: Download mnapoli/metamodel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mnapoli / metamodel example snippets


Article(1)

Article(*)

Category(1).articles

// Will call generateExtract() on all articles
Article(*).generateExtract()

Article[author="bob"]

UserGroup[ users.contains(User(1)) ]
UserGroup[ users.count() > 0 ]

CacheService.flush()

    $metaModel = new MetaModel();
    $metaModel->addObjectManager(new EntityManagerBridge($entityManager));
    

    $metaModel = new MetaModel();
    $metaModel->addContainer(new PHPDIBridge($container));