Welcome Guest, Not a member yet? Register   Sign In
IgnitedRecord 1.0 pre-release
#41

[eluser]m4rw3r[/eluser]
Still a bit busy with school, but I have only two tasks left to finish Big Grin .

I wonder what features you would like to see in future versions of IgnitedRecord.
If you have anything, please post!

PS. Are there anyone who have tried the limited support for multiple primary keys? Does it work well?
#42

[eluser]ben_co[/eluser]
I'll test the multi-PK feature this week-end if I have some free time ;-) ...
#43

[eluser]Unknown[/eluser]
Hi!
Thank you for your library!
I have a question: it looks like id is not any more accessible from IgnitedRecord_record object
Am I wrong?

What if I need to make something like

**controller**
Code:
$this->data['records'] = $this->pages->find_all();

**view**
Code:
<? foreach ($records as $row): ?>
<a href="/pages/&lt;?= $row->id ?&gt;" > more info about this page </a>
&lt;?  endforeach;  ?&gt;

Second question. Is there any way to order by results in a query?

I hope it can help you...
#44

[eluser]m4rw3r[/eluser]
You're correct, IgnitedRecord hides the id, the reason behind it was to protect the id from modification.
It is the constructor in IgnitedRecord_record that hides the id, in combination with _dbobj2ORM().
Now I see how foolish it was, but you can use $row->__id as a quick fix.
$row->__id always contains the id, no matter what column name(s) you use.

In the next version I'll add a method for fetching the id (method, because ids are supposed to be immutable).

To use order by, use CodeIgniters ActiveRecord methods:
Code:
$this->db->where('active',true); // some custom filtering :-)
$this->db->order_by('title','DESC');
$pages = $this->page->find_all();
#45

[eluser]flojon[/eluser]
Thank you for a very nice model library!

I don't know if it's been reported by I found a problem in IgnitedRecord::find_all_by()
Code:
$query = $this->db->get_where($this->__table, $where, 1);
Notice the extra 1 in the end which will only return 1 record when we really wanted all records
#46

[eluser]m4rw3r[/eluser]
Version 0.1.1 is out!

The changes:
- Added the method uid() to IgnitedRecord_record
- Added yamlfactory()
- Added calls to DB_result::free_result() in all get methods, makes IgnitedRecord hog less memory and it becomes a bit faster
- Made the includes of the behaviour files relative to the ignitedrecord.php path
- Remade the factory() method, it now takes the tablename as the first parameter, and it is more effective, no more eval()
- _get_modelname() now searches for models with tablename or singular of tablename both among the defined classes and in the CI object (propertyname = modelname)
- Tree behaviour:
- - Added is_child_of() and is_descendant_of()
- - Made the root cache per model instead of per object
- - id column is now fetched from the IgnitedRecord object
- - The behaviour now checks if MPTtree already is loaded before loading
- - Fixed is_orphan()
- Fixed a typo in find_all_by(), forgot db and a 1 too much (thanks flojon)

Download: CI Base

Feel free to C&C;!
#47

[eluser]m4rw3r[/eluser]
I have now updated the Assembla space and moved all code the their SVN.

So the latest is on the SVN (but it will probably be (partially?) broken most of the time).

I will also try to keep the space up to date with the development.

(Where are all comments? Tongue)
#48

[eluser]flojon[/eluser]
Hey, I really like your IgnitedRecord class! :-)

Since I wanted to have timestamps I implemented a timestamped behaviour.
Now I can just add two datetime columns - created_at and updated_at - to my table and use this in my model:
Code:
var $__act_as = 'timestamped';
and the timestamps will be handled automatically.

If anyone is interested the file is available here:
IgnitedRecord Timestamped behaviour

See comments in file for more usage information.

Comments:
I have only tested this with MySQL and PHP5, but the code is pretty simple so it should work with PHP4. I'm not sure how datetime is handled in databases.
#49

[eluser]m4rw3r[/eluser]
Thanks!

That behaviour is very simple and very useful, now I won't have to worry about updating timestamps in my to be CMS! :-)

May I bundle that behaviour with IgnitedRecord? (you will of course have full credit for it)

I'm also working on an improvement (rewrite from scratch) of CodeIgniter's AR library, and I wonder if there are any features you would like to have in the new one?
I will try to keep it backwards compatible as much as possible.
#50

[eluser]flojon[/eluser]
Yes, feel free to include it!

Right now I cannot think of any features I miss in the AR library, but I will think about it...

Regards,
Jonas




Theme © iAndrew 2016 - Forum software by © MyBB