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

Both models have a habtm relationship.

hi there,

I found an error in IgnitedRecord where the constructor is different the class name in line 117 and 119, on file relproperty.php...


Don't know what it can be just by looking at that (have you got the latest from SVN?).

You're using an old version, it has been corrected in a later revision.

hi m4rw3r, thanks for the answer, i was using the version 0.2.

But the old version i was using the has_many perfectly, and I had problems just with HABTM, but now, after the download( the version 1.0 ) i can´t use both.

This is a simple relation where one custumer could be many address...

file/model: Cli_model.php
var $has_many = array(

file/model: Ecl_model.php
var $belongs_to = array(
        'name'  => 'Cli_model',
        'model' => 'Cli_model',
        'table' => 'PRODWEB.PUBLCLI_T',
        'fk'    => 'IDCLI',


I know that this method return false If there are no relation defined,but there are

One difference to the 1.0 version is that it can only be one model per table, it makes it a lot easier to handle everything - both for the user and me.
Unfortunately you are affected badly by this, but you can actually relate to the same model with a relation (only using different keys.

Hi again,

where in the new userguide can I find an explanation of how this works(?):

“Has And Belongs To Many relationships now utilizes JOINs which enables extra data to be fetched from the join table
This feature is called attributes, which makes it possible to add specific data for a relation between two records.” // v1.0 - changelog

Thanks for your time.


PS - OK now I have arrived at the point where I need to know the answer to this or proceed without IR. I Know you must be busy with all the college stuff. I hope you can spare a moment Smile Thanks.


How i can update without select before? Or how i can user $this->db in ignitedRecord ?
I try this but it don't work
$this->where('id',1)->set('views', 'views+1', FALSE)->update($this->table);

So, and have next question, generated by IgnitedRecord
LEFT JOIN `answers` ON questions.id = answers.q_id
if i need specific condition for join for get this
LEFT JOIN `answers` ON questions.id = answers.q_id AND answers.deleted='n'
what or where i must add my condition in the model?

Use the attr setting on the $habtm var:
$habtm = array('table' => 'page', 'attr' => 'color');
// setting things:
$rec->add('pages', $a_page, array('color' => 'blue'));
PS. sorry that I'm late with the response, currently busy with a lot of school work and starting with the ORM Project

Use the where() method, there isn't a good way to add extra conditions to the internally constructed parts of the query.
This is something I've added to the ideas for the project.

EDIT: I forgot to answer your query problem: Use IgnitedQuery or AR for that.
IgnitedQuery usage is just like AR with the difference of $query = new IgnitedQuery(); $query->select()...

If you have ideas for the new ORM/db abstraction tool I'm planning, post them (ideas for IR is also accepted, but have a low priority).

[eluser]Paul Apostol[/eluser]
I wrote this post, I deleted, I rewrite again. I think I'm too tired.So
As an example I have a person which have a set of properties and each property has a type (first HM-BT and second BT-HM)
Doesn't work ($person is taken from a find(id) ) :
Any idea? I've made a mistake? It has to be like that?
I have used instead (and is working):
$this->property->join_related('proptype')->find_all_by('person_id', id);


Theme © iAndrew 2016 - Forum software by © MyBB