You could not use the model Eigenschaftsarten using static access, use this:
ClassRegistry::init('Eigenschaftsarten')->find(...)
Em quinta-feira, 8 de março de 2012 05h59min45s UTC-3, heohni escreveu:
>
> Hi,
>
> I have this model 'Eigenschaftsarten'
>
> class Eigenschaftsarten extends AppModel {
> var $name = 'Eigenschaftsarten';
> var $useTable = 'Eigenschaftsarten';
> var $primaryKey = 'EIA_ID';
>
> function getEIA_IDNames($array){
> $return = $this->find('first', array(
> 'conditions' => array(
> ''
> ),
> 'fields' => 'EIA_UEN_BESCHREIBUNG'
> )); debug($return);
> }
> }
>
> and I have another model where I want to use the function ' getEIA_IDNames
> '
>
> App::uses('Eigenschaftsarten', 'Model');
> class Objekt extends AppModel {
> function reduceEia($params){
> debug(Eigenschaftsarten::getEIA_IDNames($params));
> }
> }
>
> I can access the model 'Eigenschaftsarten' but the function '
> getEIA_IDNames '
> returns me this statement:
>
> *SQL Query: *SELECT `Objekt`.`EIA_UEN_BESCHREIBUNG`, `Objekt`.`OBJ_ID`
> FROM `myproject`.`Objekt` WHERE 1 = 1 LIMIT 1
>
> I don't understand this!!
> Why is the model 'Eigenschaftsarten' not reading the table var
> $useTable = 'Eigenschaftsarten'; ??
> Why it is reading from the model 'Objekt'?
>
> 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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php