Re: How lo load a model from a model?

2012-03-08 Thread phpMagpie
Is there a benefit/drawback to using 
ClassRegistry::init('Objekt')->translateStrings($results); in this 
situation?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How lo load a model from a model?

2012-03-06 Thread Rodrigo Rodrigues Moyle
Use:

$this->load('Objeckt); instead of App::uses()

Em terça-feira, 6 de março de 2012 08h14min42s UTC-3, heohni escreveu:
>
> Hi,
>
> class DetailsController extends AppController{
> var $name = 'Detail';
>
> public function index($id){
> if($id){
> $results = $this->Detail->find('first', $conditions['Gesamtobjekt']);
>
> App::uses('Objekt', 'Model');
> $results = $this->Objekt->translateStrings($results);debug($results);
> }
> }
> }
>
> What do I have to do, to get the  $this->Objekt->translateStrings working?
> Right niow, I only get 
> *Fatal error*: Call to a member function translateStrings()  
> Message.
>
> What do I miss?
> I tried to get an info from the book, but I only find how to write the 
> App::uses but I didn't find any further note..
>
> Please advice! 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How lo load a model from a model?

2012-03-06 Thread Jeremy Burns | Class Outfit
Put in a Behaviour and apply the behaviour to each model that needs to use it.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 6 Mar 2012, at 11:37:03, heohni wrote:

> No there is not.
> But I just found out that I can use it this way:
> 
> $results = Objekt::translateStrings($results);
> 
> But - the function  translateStrings() is using inside a call to 
> $this->ExtractUet() and now it happens that I get the message  
> Fatal error: Call to undefined method DetailsController::ExtractUet()
> 
> What do I have to do? In order to use the complete  translateStrings 
> functionality? 
> 
> 
> Am Dienstag, 6. März 2012 12:17:28 UTC+1 schrieb Jeremy Burns:
> Is there a model association between the two models? If so, you can daisy 
> chain them:
> 
> $results = $this->Detail->Objekt->translateStrings($results);debug($results);
> 
> 
> Jeremy Burns
> Class Outfit
> 
> http://www.classoutfit.com
> 
> On 6 Mar 2012, at 11:14:42, heohni wrote:
> 
>> Hi,
>> 
>> class DetailsController extends AppController{
>> var $name = 'Detail';
>> 
>> public function index($id){
>> if($id){
>> $results = $this->Detail->find('first', $conditions['Gesamtobjekt']);
>> 
>> App::uses('Objekt', 'Model');
>> $results = $this->Objekt->translateStrings($results);debug($results);
>> }
>> }
>> }
>> 
>> What do I have to do, to get the  $this->Objekt->translateStrings working?
>> Right niow, I only get
>> Fatal error: Call to a member function translateStrings() 
>> Message.
>> 
>> What do I miss?
>> I tried to get an info from the book, but I only find how to write the 
>> App::uses but I didn't find any further note..
>> 
>> Please advice! 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How lo load a model from a model?

2012-03-06 Thread heohni
No there is not.
But I just found out that I can use it this way:

$results = Objekt::translateStrings($results);

But - the function  translateStrings() is using inside a call to 
$this->ExtractUet() and now it happens that I get the message  
*Fatal error*: Call to undefined method DetailsController::ExtractUet() 

What do I have to do? In order to use the complete  translateStrings 
functionality? 


Am Dienstag, 6. März 2012 12:17:28 UTC+1 schrieb Jeremy Burns:
>
> Is there a model association between the two models? If so, you can daisy 
> chain them:
>
> $results = 
> $this->Detail->Objekt->translateStrings($results);debug($results);
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 6 Mar 2012, at 11:14:42, heohni wrote:
>
> Hi,
>
> class DetailsController extends AppController{
> var $name = 'Detail';
>
> public function index($id){
> if($id){
> $results = $this->Detail->find('first', $conditions['Gesamtobjekt']);
>
> App::uses('Objekt', 'Model');
> $results = $this->Objekt->translateStrings($results);debug($results);
> }
> }
> }
>
> What do I have to do, to get the  $this->Objekt->translateStrings working?
> Right niow, I only get 
> *Fatal error*: Call to a member function translateStrings()  
> Message.
>
> What do I miss?
> I tried to get an info from the book, but I only find how to write the 
> App::uses but I didn't find any further note..
>
> Please advice! 
>
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> at http://groups.google.com/group/cake-php
>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How lo load a model from a model?

2012-03-06 Thread Jeremy Burns | Class Outfit
Is there a model association between the two models? If so, you can daisy chain 
them:

$results = $this->Detail->Objekt->translateStrings($results);debug($results);


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 6 Mar 2012, at 11:14:42, heohni wrote:

> Hi,
> 
> class DetailsController extends AppController{
> var $name = 'Detail';
> 
> public function index($id){
> if($id){
> $results = $this->Detail->find('first', $conditions['Gesamtobjekt']);
> 
> App::uses('Objekt', 'Model');
> $results = $this->Objekt->translateStrings($results);debug($results);
> }
> }
> }
> 
> What do I have to do, to get the  $this->Objekt->translateStrings working?
> Right niow, I only get
> Fatal error: Call to a member function translateStrings() 
> Message.
> 
> What do I miss?
> I tried to get an info from the book, but I only find how to write the 
> App::uses but I didn't find any further note..
> 
> Please advice! 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


How lo load a model from a model?

2012-03-06 Thread heohni
Hi,

class DetailsController extends AppController{
var $name = 'Detail';

public function index($id){
if($id){
$results = $this->Detail->find('first', $conditions['Gesamtobjekt']);

App::uses('Objekt', 'Model');
$results = $this->Objekt->translateStrings($results);debug($results);
}
}
}

What do I have to do, to get the  $this->Objekt->translateStrings working?
Right niow, I only get 
*Fatal error*: Call to a member function translateStrings()  
Message.

What do I miss?
I tried to get an info from the book, but I only find how to write the 
App::uses but I didn't find any further note..

Please advice! 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php