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

[eluser]Gaz[/eluser]
Both models have a habtm relationship.

[eluser]DGmike[/eluser]
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...

right?

[eluser]m4rw3r[/eluser]
@Gaz:
Don't know what it can be just by looking at that (have you got the latest from SVN?).

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

[eluser]DGmike[/eluser]
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
Code:
var $has_many = array(
         'name'=>'Ecl_model',
         'model'=>'Ecl_model',
         'table'=>'PRODWEB.PUBLECL_T',
         'fk'=>'IDCLI'
    );

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

file/controller
Code:
$rec->add('Ecl_model',$r);

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

[eluser]m4rw3r[/eluser]
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.

[eluser]jinfusion[/eluser]
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.

Joel

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.

Joel

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

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

[eluser]m4rw3r[/eluser]
@jinfusion:
Use the attr setting on the $habtm var:
Code:
$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

@MisterX:
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()...

@All:
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)
Works:
$this->property->join_related('proptype')->find_all();
Doesn't work ($person is taken from a find(id) ) :
$person->related('property')->join_related('proptype')->get();
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);

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB