Welcome Guest, Not a member yet? Register   Sign In
[split] CRUD? <CodeIgniter 4 Proposed Roadmap>
#7

(This post was last modified: 08-02-2016, 09:09 AM by kilishan.)

(08-02-2016, 05:01 AM)Jordy Wrote: I have one question tho, are they all Std Objects now? I can now see that you have to create a data array to insert data, which isn't really OOP is it? Wouldn't it be better to have PoPo's somewhere with actual classes? Like `$user = new User(); $user->username = 'test'` etc. I know that you can cast the result as an Object, and you can insert one as well with an object, but it doesn't seem to be the default. Is there a place where we can store our Objects like 'User' etc?

It works much like it always has, where you can get the results back as an array, an object, or a custom class, like User. If you're looking for an ActiveRecord-style object, sorry, but that won't be included. In each of your model's, though, you can define the class to return results as in the $returnType setting. So, we keep the flexibility and explicitness that CI has always been known for. If you want Laravel-like ActiveRecord ORM, or Collections returned, or Doctrine-style DataMapper, you'll have to build that layer yourself, or import their library into yours. But it has always been part of CI's history to not force you into any one manner, and allow you to work like you want. We're trying to live up that.

That being said, it's always possible to pull in Doctrine, or Eloquent, or PHPActiveRecord, or whatever, and use that and skip our database layer altogether to get exactly what you're wanting.

(08-02-2016, 07:07 AM)patel.ganesh28 Wrote: I am expecting Like Yii Framework

Not familiar with how Yii handles it but if you're looking for an ORM, you're out of luck. That's been discussed many times and isn't going to ship with CI. Sorry.
Reply


Messages In This Thread
RE: [split] CRUD? <CodeIgniter 4 Proposed Roadmap> - by kilishan - 08-02-2016, 09:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB