2 answers
0 votes
How to find which combination Clubs is being used by Children?
Child hasMany Membership
Membership belongTo Child, Club
Club hasMany Membership
Basically Child HABTM Club with the Membership being the join table,
like at the bottom of this section:...
3 answers
1 vote
Selecting just some fields in a HABTM findAll() query
How can I select a defined list of fields in a findAll() query which runs on a HABTM model. I have the model diagram with HABTM tags. In the tag model I use:
$this->Tag->findAll();
This returns a correct result but the query selects all(!)...
1 answer
0 votes
find - conditions - uppercase in LIKE
Hi,
I'm having data with upper and lowercase, ex. Company, COMPANY etc. As I tested LIKE is case sensitive.
<?php $partners = $this->Partner->find('all', array(
'conditions'=>array('Partner.name... 1 answer
0 votes
findAll and hasMany
Hi,
I have four models, Company, Employee, BusinessUnit and BusinessUnitMember
Company belongsTo Employee
Employee hasMany BusinessUnitMember
BusinessUnitMember belongsTo BusinessUnit
BusinessUnit hasMany ...
1 answer
0 votes
find conditions
hi all,
Ho do I create this sql with cakephp
SELECT `item`.`id`, `item`.`name_1`, `item`.`name_2`
FROM `item`
WHERE `item`.`name_1` != `item`.`name_2`
Thanks
1 answer
0 votes
possible to use find('list') across models?
are there any cakephp way of using find('list', array('fields' = array('User.id', 'Profile.nickname')))); ?
if i do that it'll throw an error.
for the time being i am using a function i wrote to get the list, not flexible function at that.
Your...
1 answer
0 votes
Subquery in Select From, how di I do this?
Hi, how do I convert this query (with subquery):
SELECT * FROM (SELECT * FROM Logs ORDER BY Logs.created DESC) AS a GROUP BY Logs.id ORDER BY Logs.created DESC
to a CakePHP find condition?
2 answers
0 votes
Can i work directly on the results of a find?
This is *probably* more a basic php question, but i'm new to php, and i don't really know where to go, so...
I have here a find operation:
$this->User->find('first',array('fields'=>'password'))
is it possible to, well, just plain ol' extract data...
3 answers
0 votes
1 answer
0 votes
Counts for Associated Tables (hasMany)
I'd like some advice on the CAKE way of getting a count of an associated (recursion 1) table, and paginating that. e.g.
Recipe belongsTo Author
Recipe hasMany Commentsin my recipes_controller I have a function recentRecipes()` that will perform a...
0 answers
0 votes
HABTM depth find
Hi!
I have:
Fi HABTM Group, User
Group HABTM Fi, User
User HABTM Fi, Group
In my Fi Controller I want to find if a given Fi is associated with a particular user either directly (in fis_users) or indirectly (fis_groups - group - groups_users).
Is there...
3 answers
0 votes
Set find() conditions in the model
Hi everybody, I'm brand new to CakePHP and I'm discovering with pleasure its features :)
Is there a "Model property"-like manner (or a property; I couldn't find one in the API doc) to set the find 'fields' and 'conditions' conditions ?
Instead of...
2 answers
0 votes
I can't get a user data condition requested with a null and spesific id
<?php
function someController()
{
$user_id = $this->Session->read('Auth.User.id');
$this->Announcement->recursive = 1;
$this->paginate = array
(
'conditions' => array
(
'Announcement.user_id' => array($user_id,null)
),
'limit'... 1 answer
1 vote
Condition dans HABTM
Bonjour,
J'ai des vidéos qui HABTM tags.
J'aimerai récupérer la liste de toutes les vidéos qui ont au moins un tag, comment faire ?
Merci.
1 answer
0 votes
query
Hi, what would this query look like as per cake?
'SELECT COUNT( * )FROM orders`LEFT JOIN `product_details` AS `ProductDetail` ON ( `orders`.`product_detail_id` = `ProductDetail`.`id` )WHERE `ProductDetail`.`new_or_used` = "New" GROUP BY...
3 answers
0 votes
model->find()
I want to ask soemthing simple that I did not find at manual.
I want at model->find('list',array()) to write which exactly field will return of the table.
How can I do that?
1 answer
0 votes
find deep relationship using cakephp's way
Hi i looking for the correct cakephp's way to this
This are my models
Area hasMany Poll
Poll hasMany Answer
Institution hasMany Answer
Now i need show the Answer group by Poll and Area by a year and and
for institutions
the output is some like...
1 answer
0 votes
Complex find condition query encapsulating values in single quotes
Hi,
I'm moving a mysql query from 1.1 to 1.3-RC1
$conditions = array("OR" => array(
'Item.expiration' => 0,
'Item.expiration >' => "NOW()"
)
);
$params = array(
'conditions' => $conditions
);
$items =... 1 answer
0 votes
HABTM association and find
In my application, Blogs HABTM Tags. I want to select items that has blog.name LIKE = "one" OR blog.owner LIKE = "two" OR tag.name LIKE = "three".
For some reason it is selecting wrongly, it is not selecting when the blog.name or blog.owner...
1 answer
0 votes
Cakephp, Retreive Data for HABTM Models using find
I am new to cakephp and I'm trying to accomplish something that should be relatively easy. I have 2 models projects & categories bind by HABTM relationship.
I am trying to perform the following query - find all projects that belong to a...