PHP code example of gollumsf / manager

1. Go to this page and download the library: Download gollumsf/manager 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/ */

    

gollumsf / manager example snippets


namespace App\Manager;

use GolumSF\Manager\Manager;

class UserManager extends Manager {
}

namespace App\Controler;

use App\Manager\UserManager;

class MyControler {
	
	myAction(UserManager $userManager) {
		return Response($userManager->getEntityClass());
	}
	
}

 * public getEntityClass(): string                // Return class name fo entity
 * protected getEntityManager(): string           // Return entity manager
 * public getRepository(): ?ObjectRepository      // Return repository of entity
 * public delete($entity): Entity                 // Delete the doctrine entity
 * public update($entity): Entity                 // Persist and flush the entity 
 * public find($id): Entity|null                  // Return the entity of id (wrapper of repository->find)
 * public findOneBy(array $criteria): Entity|null // Return the entity of criteria (wrapper of repository->findOneBy)
 * public findBy(                                 // Return the entities of criteria (wrapper of repository->findBy)
        array $criteria, 
        array $orderBy = null, 
        $limit = null, 
        $offset = null
	): Entity[]