I have no idea.
I tried many things and nothing works.
For exampple:
$this->Item->find("all", array("fields" => array("Item.id",
"Item.thumb"),
"contain" => array(
"ItemContent" => array(
"conditions" => array("ItemContent.language_id" => $this-
>language_id),
"fields" => ar
I don't know how to make my own sql code into Complex Find Conditions.
Especially with use of INNER JOIN or LEFT INNER.
For example:
$items = $this->Tag->query("SELECT Item.id, Item.thumb,
ItemContent.name, ItemContent.description, ItemContent.url,
Module.code FROM items AS Item INNER JOIN items_
Maybe you're right. But even I can't make silimar cakephp find method
to my own sql code.
For example:
If I use brian's code above I got error: Unknown column
'ItemContent.language_id' in 'where clause'. It's because table
ItemContent is just used at 2. query. And I do not know how to set
conditi
array('ItemContent.language_id' =>
> $this->language_id);
>
> The reason for that is you can use $this->language_id when defining a
> class variable.
>
> If you can't figure out how to turn your query() into a Cake find(),
> you could look into using PEAR::pager as a v
I'd like to paginate $this->Model->query().
For example I have this in my controller:
$this->Item->query("SELECT Item.id, Item.thumb, ItemContent.name,
ItemContent.description, Module.code FROM items AS Item INNER JOIN
items_content AS ItemContent ON ItemContent.item_id = Item.id INNER
JOIN modul
to do is ONLY save if language_id = a certain
> value, then you can test for that before you save.
>
> - Jamie
>
> On Aug 6, 5:02 pm, gjofum wrote:
>
> > I'd like to update data in db, but I have a problem.
>
> > If I use $this->...->save(...); it'
I can set up primaryKey in model by variable $primaryKey.
But how can I set up that I don't have primaryKey or I don't want it?
(Actually I don't want to use primaryKey from my db.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
I'd like to update data in db, but I have a problem.
If I use $this->...->save(...); it'll only use id (primaryKey) in
clause WHERE. But I need one more (id = ? and language_id = ? in
clause WHERE).
How can I do that?
--~--~-~--~~~---~--~~
You received this message
"rule" => array("maxLength", 10),
> "message" => "max"
> ),
> )
> );
>
> (note where I've moved 'required' to - it needs t
I am setting data a then validate them.
$this->Module->set($this->data);
if($this->Module->validates()) print "YES";
else print "NO";
But I have one more problem. I get 2 errors with just validate rule
below.
Warning (2):
It doesn't help.
On Jul 17, 9:58 am, joshua wrote:
> Mine:
>
>
>
> > 'email' => array(
>
> 'noEmpty' => array(
>
> 'rule' => 'email',
>
> 'allowEmpty' => false,
>
> 'message' =
I add notEmpty and it still doesn't work.
var $validate = array(
"module_data" => array(
"module_dataRule1" => array(
"rule" => "notEmpty",
"message" => "empty"
I have this validate in Model:
var $validate = array(
"module_data" => array(
"module_dataRule1" => array(
"rule" => array("minLength", 5),
"message" => "min"
),
13 matches
Mail list logo