For example, I have a Product, and I have a BaseProduct. In the model for the Product, I’ve specified the following: In the BaseProduct, I’ve specified the following relationship: If I were to select a product, like so: I could get the BaseProduct by doing the following: Instead of getting the array of the result from that, how would I
Tag: orm
Bake every table in CakePHP?
The database I’m working on has more than 100 tables, so I’m not going to sit here baking a model and controller for each one individually. I would like to bake all of the tables at the same time with something like the .xml files in Hibernate that tells it the limitations on fields so that I don’t have to
Laravel: belongsTo() relation assume one-to-many relationship instead of one-to-one
I’m having a tedious problem with Laravel’s ORM. I have a model with multiple relationships, like this: Now I can access the template related item in a simple way, like this: And it works out of the bat, because Laravel’s ORM assumes it is a one-to-one relationship and internally calls the first() method. But when I try the same with
Object-Relational Mapping vs Database Abstraction Layer
I’m using Doctrine which provides both ORM and DBAL. What is difference between them? How should one decide when to use which?
How to bulk insert with RedBeanPhp?
I was hoping for an example on how to bulk insert new “beans” in readbeanphp without looping over each instance. It shows an example creating and saving a beans here: http://redbeanphp.com/manual/…
Doctrine – How to print out the real sql, not just the prepared statement?
We’re using Doctrine, a PHP ORM. I am creating a query like this: and then in the function I’m adding in various where clauses and things as appropriate, like this Later on, before execute()-ing that query object, I want to print out the raw SQL in order to examine it, and do this: However that only prints out the prepared