Welcome Guest, Not a member yet? Register   Sign In
Recursive saving and selecting
#1

[eluser]Unknown[/eluser]
I'm totally new to CodeIgniter. I have one big question.

Let's say I've enabled ActiveRecord. Let's also say that I've got a Blog class and a Post object. A Blog has many Posts.

Here's some pseudo code:

$blog->posts[] = new Post(a,b,c);
$blog->posts[] = new Post(d,e,f);
$blog->save();

In this circumstance, will the Posts be saved along with the Blog? Will it work properly whether updating, inserting or deleting?

Thanks.
#2

[eluser]Colin Williams[/eluser]
It depends on what your save() method does.




Theme © iAndrew 2016 - Forum software by © MyBB