Welcome Guest, Not a member yet? Register   Sign In
DataMapper ORM v1.8.2

[eluser]WanWizard[/eluser]
This is thanks to a change in the core, since 2.1.

I've been discussing this with the development team, but they feel that if $this->lang->line() is used, you better make sure the requested language line exists. So this error is there to stay.

I've started with (yet another) workaround for that, the bootstrap is already prepared, but I haven't updated the library yet.

You should be able to replace all instances of "$this->lang->line" by "$this->lang->dm_line" in datamapper.php, and your problem should be gone.

[eluser]7amza[/eluser]
i did that but now the model return Null !! evenif there is data to display in DB !!
UPdate : when i dump the model i found the data but when i foreach it nothing happens (Null!)

[eluser]WanWizard[/eluser]
What exactly returns NULL?

There are exactly 4 calls to $this->lang->line() in the Datamapper library, none of them having to do with how the model deals with data.

[eluser]7amza[/eluser]
i have 4 entries in the group table
so when i call :
Code:
$g = new group();
$g->get();
foreach($g as $p){
echo $p->id;
}
i don't get anything!!

[eluser]WanWizard[/eluser]
And that is related to the lang->line change? If you revert that change, it works again?

[eluser]7amza[/eluser]
no it doesn't work !! im an ORM addicted so i use it everytime but i faces this kind of problems when i upgradted to CI 2.0 & DM 1.8.2.1

[eluser]WanWizard[/eluser]
As posted in your other thread about this subject, there is no official support for the current DM on 2.0.0, only 2.0.3 and above. You have to hack the core to get it to work.

If you currently run DM 1.8.2.1 on CI 2.0, you haven't even installed the bootloader in your index.php, because if you had done so, you would have had a fatal error due to redefinition of the load_class() function.

Having said that, with the core hack in place to deal with that fatal error, all my test code and the example application runs flawlessly here, with the latest DM on CI 2.0.0.

So for the moment I'm going to assume the issue is in your code.

[eluser]wisepotato[/eluser]
is it possible to insert custom variables into your models ? (that's what I use models for) For example I have a photo model, and I want to access $photo->link to insert a link into the template.

How should I go about doing this? I have done this:

public function get($limit = NULL, $offset = NULL)
{
// call the original method
parent::get($limit, $offset);


//we need to loop over every object
$this->img_src = 'images/' . $that->image;
$this->href = site_url('media/fotos/' . $that->id . '/');



// for method chaining
return $this;
}

[eluser]tarciozemel[/eluser]
That's isn't the way to use DataMapper... Do you read the manual?


[quote author="wisepotato" date="1338724127"]is it possible to insert custom variables into your models ? (that's what I use models for) For example I have a photo model, and I want to access $photo->link to insert a link into the template.

How should I go about doing this? I have done this:

public function get($limit = NULL, $offset = NULL)
{
// call the original method
parent::get($limit, $offset);


//we need to loop over every object
$this->img_src = 'images/' . $that->image;
$this->href = site_url('media/fotos/' . $that->id . '/');



// for method chaining
return $this;
}[/quote]

[eluser]WanWizard[/eluser]
If you need post-processing, look in the manual for get-rules.




Theme © iAndrew 2016 - Forum software by © MyBB