Skip to Content.
Sympa Menu

comanage-dev - Re: [comanage-dev] Containable question

Subject: COmanage Developers List

List archive

Re: [comanage-dev] Containable question


Chronological Thread 
  • From: Benn Oshrin <>
  • To: Scott Koranda <>,comanage-dev <>
  • Subject: Re: [comanage-dev] Containable question
  • Date: Tue, 10 Apr 2012 13:18:07 -0400

Two thoughts (am on a train atm)... does the Co model have actsas containable? Also, I've had really bad luck getting containable to work with findbyfoo. Try a normal find and pass contains as a param.

Scott Koranda <> wrote:
Hi,

Inside of my Grouper data source when I receive a co_id I need
to get the name of the CO.

So I have written this:

$Co = ClassRegistry::init('Co');
$co = $Co->findById($data['co_id']);
$co_name = $co['Co']['name'];

It works as I expect.

Trying to be a good citizen and follow the coding guidelines I
wanted to use 'contain'. So I did this:


$Co = ClassRegistry::init('Co');
$Co->contain();
$co = $Co->findById($data['co_id']);
$co_name = $co['Co']['name'];

That fails with

Error: SQLSTATE[42000]: Syntax error or access violation: 1064
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax
to use near 'contain' at line 1

Any thoughts?

Scott



Archive powered by MHonArc 2.6.16.

Top of Page