Hi,
I have two models: Member and Department which HABTM each other.
I'm doing the following find:
$this->Member->Department-
>find('all',array('conditions'=>array('Department.name LIKE'=>'%'.
$somesearchvalue.'%')));
This gives me a resulting array where each position has the Department
data pl
Thanks a lot for your reply John.
I'll try with that example you linked me. I think that would do the
trick.
I really appreciate your reply John. Regards
On 18 jun, 02:26, John Andersen wrote:
> Take a look at using the same solution as in the FilterTag example in
> the CakePHP book,
> see:http
Take a look at using the same solution as in the FilterTag example in
the CakePHP book, see:
http://book.cakephp.org/view/1039/Associations-Linking-Models-Together#hasAndBelongsToMany-HABTM-1044
The last example is the one. Maybe it can be applied to your issue :)
Enjoy,
John
On Jun 18, 6:40 a
Hi!
I've been struggling with something that I cannot seem to get working.
I have this relationship: Treatment HABTM Symptom
What I want to do is: search treatments by symptom, and the result
must display treatments fields (id, name, cost, etc).
For now, I've been doing this in treatments_contro
Thanks Calvin. I get it.
On May 20, 8:44 pm, calvin wrote:
> I mean referencing the model object itself, i.e. $this->User->find()
> instead of $model->find() or User->find().
>
> On May 20, 10:18 am, bradmaxs wrote:
>
>
>
> > Thanks Calvin.
>
> > When you say access models from controllers, do y
I mean referencing the model object itself, i.e. $this->User->find()
instead of $model->find() or User->find().
On May 20, 10:18 am, bradmaxs wrote:
> Thanks Calvin.
>
> When you say access models from controllers, do you mean with find().
>
> Trying some different methods as we speak.
>
> On Ma
Thanks Calvin.
When you say access models from controllers, do you mean with find().
Trying some different methods as we speak.
On May 20, 4:07 am, calvin wrote:
> Assuming that's exactly what your code looks like, the
> T_OBJECT_OPERATOR error is probably because you're putting a
> T_OBJECT_OP
Assuming that's exactly what your code looks like, the
T_OBJECT_OPERATOR error is probably because you're putting a
T_OBJECT_OPERATOR ("->") after a constant ("User"). If you want the
model, then you need to write $this->User. Likewise, unless you
declared a variable previously named $model, callin
Thank you, thank you, thank you!!
I put it in my controller tonight and it worked like a charm.
I am going to try the model method tomorrow and I will let you know
how that goes.
Brad
On May 19, 10:52 pm, Jeremy Burns wrote:
> Thanks...
>
> Well that seems a fairly simple array. You could eith
Thanks...
Well that seems a fairly simple array. You could either make it a function in
your User model:
function emailAddress($id = null) {
if (!$id) return "";
$this->id = $id;
return $this->User->field('email_address');
}
This ought to return the email addr
Wow - Jeremy you are the man with many awesome suggestions.
This is my first BIG project using cake (which is amazing) so I am
trying to do it all. I thought I would get the app working and then
go back and add all the goodies. It seems every time I look through
the book (1 million times a day)
Cake find results are always (he says, sticking his neck out!) arrays, so even
if you cracked your second challenge, you're still going to get an array. I'd
suggest refining the first find example (as it works) so that the resulting
array is smaller.
Can you post the contents of the array here?
I want to send an email with the email component. No problem there.
However, I don't want it to be a hidden field in the form so I thought
I could do something in the controller.
So I did this line:
$email = $this->User->find('first', array('conditions' =>
array('User.id' => $this->data['Friend
so crazy... but
//var $hasMany = 'Veiculo';
var $hasOne = array('PessoaFisica', 'PessoaJuridica','Veiculo');
get all left joins in one SELECT
On 3 nov, 14:09, Celso wrote:
> Hello Everybody!
> I have this models:
>
> http://picasaweb.google.com.br/celsowm/Screenshots#539991579700209177
Hello Everybody!
I have this models:
http://picasaweb.google.com.br/celsowm/Screenshots#5399915797002091778
And i need retrieve this:
Proprietario.nome , Veiculo.placa , sum (Infracoes.pontuacao) as
pontos
Proprietario "hasMany" Veiculo
Veiculo "habBelongsToMany" Infracoes
--~--~---
the model name should be singular(Teacher) but u r giving plural(Teachers)
On Thu, Mar 12, 2009 at 12:06 AM, Dave Maharaj :: WidePixels.com <
d...@widepixels.com> wrote:
> Not sure what I am doing here. Been trying to no avail.
>
> What I am trying to do is find the id of the logged in user from
Fields should be an array I believe. So your entire query should be:
$this->User->find('list', array('conditions' =>array
('Teachers.user_id' => $this->Auth->user('id')), 'fields'=>array
('Teachers.user_id')
On Mar 11, 2:36 pm, "Dave Maharaj :: WidePixels.com"
wrote:
> Not sure what I am doing
Not sure what I am doing here. Been trying to no avail.
What I am trying to do is find the id of the logged in user from TEACHERS
table WHERE the user_id is $this->Auth->user('id');
$conditions = array('Teachers.user_id'=>$userId);
$fields = 'Teachers.user_id';
$teacherID = $this->User->Teach
18 matches
Mail list logo