Gas ORM |
[eluser]toopay[/eluser]
@lnguyen, what exactly you need. @jameshang, thats how ActiveRecord ORM works. If you need more adjustment, consider to write Gas ORM extension.
[eluser]lnguyen[/eluser]
@toopay: may be count_all_result() function is not working. So you can check it or guide me how can i count all record with my conditions. ----------------------- Now i added code in Gas.php file and it working good: Code: public function count()
[eluser]rei[/eluser]
Hi, I'm doing something like this: Code: $all_users = Model\User::with('blog')->all(); But why the output is: Code: User kevin and he seems have several kids:User francie and he seems have several kids: It is just showing francie's post, but not showing kevin's post? Is this a bug? I enabled CI profiler and the created query is this: Code: 0.0004 SELECT *
[eluser]rei[/eluser]
I also tried this one and its giving me the results I wanted: Code: $all_users = Model\User::all(); But the problem is its making this queries: Code: 0.0004 SELECT * It always makes a new query for fetching the blog posts of EACH user. Which is not good for performance, so I really wanted to use eager loading like this one: Code: $all_users = Model\User::with('blog')->all(); I hope you can resolve the problem. Thanks
[eluser]redcloud80[/eluser]
Hi! I'm trying to use Gas ORM but I'm stuck with a many-to-many relationship. I've two tables A, B linked by a third C table Code: A fields: [id, name] on C table, a_id and b_id are FK to related tables. What I'm trying to do is to get for each A item, his name, the name of related B items plus the value from C table. E.g. Code: John, Red, 10 This is how I've defined relationships In A model: Code: self::$relationships = array( In B model: Code: self::$relationships = array( In C model: Code: self::$relationships = array( Then I get some data using this code: Code: $data['items'] = Model\A::with('b')->all(); So I can use it into view Code: foreach ($items as $a) { And now the question, does this query $data['items'] = Model\A::with('b')->all(); retrieves C table data too?
[eluser]toopay[/eluser]
No. But you could specify has_many C relationship in your A entity. Btw, this is thread for older version, go to this thread if you have further question on Gas ORM 2.
[eluser]Odie[/eluser]
Hi, Just like to know if its possible to use memcache for the caching Gas is doing?
[eluser]lnguyen[/eluser]
I found a bug. If you use join with limit conditions. Limit is return 0. Example: Code: //some code... I'm fixed. In file Gas.php line 5097. Code: //add code: and $type != 'limit' after $node
[eluser]Kimse[/eluser]
http://gasorm-doc.taufanaditya.com/valid...amp-fields Why does GasORM use "12-hour format of an hour with leading zeros" is this a mistake or by purpose? |
Welcome Guest, Not a member yet? Register Sign In |