ORM (object relational mapping) in PHP? Yes but it's not so simple! How abot separating database, layer abstractions and objects from the database? I said it's cool but all my data are on the database! So ORM will help us to get data from the database and ourDoctrine, a complex and big ORM for web applications. It... [...]
Read MoreLet's see some commands and snippet to interact with Doctrine2. If you use Netbeans IDE, you'll see how easy is to call the entityManager and other objects of this ORM. But remember to put all queries on your model and keep the controller functions as clean as you can.Enum annotationDoctrine is integrated with Sy... [...]
Read MoreI am trying to work hard with Zend framework and taking advantage using a powerful ORM like Doctrine2. I have many difficulties but after many research and coding, I've gathered some useful tricks and links.Generate entities from databaseYour application must be connected to the database and you must set the doctrine... [...]
Read MoreUnfortunately Doctrine does not support so many SQL function so you have to build a class to let him use a custom function. Let's start building a DATE_FORMAT function. Let's write the class:namespace Application\Model\Doctrine\Functions;use Doctrine\ORM\Query\Lexer;use Doctrine\ORM\Query\AST\Functions\Functi... [...]
Read MoreIf y0u have a database, probably you need to generate entities automatically. We'll use the console on app\console. But there are other small tricks you have to know. Let's see some very useful commands:MySQL enumUsing basic Doctrine commands you can have an error about enum types. It's highly recommende... [...]
Read MoreHere I am with the first post of the 2015. Happy new year! I'm still learning and working with Symfony2 and today I've had some problem about setting a custom repository class that extends a Doctrine entity. Here is the specific page and paragraph on the offcial documentation. They Symfony documentation is great, much be... [...]
Read More