App models are the classes that sit as the business layer in a CakePHP application.
0
votes
2answers
20 views
Find all distinct field values for a Model that occur N times in CakePHP
So I have a model FeaturedListing that has a field date which is a mysql date field. There will be multiple FeaturedListings that have the same date value.
I want to find all dates that have N or ...
0
votes
1answer
18 views
Joining two tables in CakePHP using bindModel method Cakephp
I am working on a cakephp 2.x .. I have two tables in my database both have the userid I am using bindModel.. my query is working fine ... I just have one problem .. I want to add the condition in ...
0
votes
1answer
21 views
Validating Multiple sets of POST data in Cakephp
I've got a Cakephp Project with an 'Addresses' table with the following structure:
CREATE TABLE `addresses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`name` varchar(50) ...
-1
votes
2answers
53 views
Deep Associations works with recursive => 2 but too slow to load [on hold]
I have 3 models Product having product_family_id as foreign key to ProductFamily and ProductFamily have customer_id as foreign key to Customer.
Putting recursive to 2 in Product model allow me to get ...
1
vote
1answer
25 views
Sequence call cake php 2 behavior callback function
I want to know how possible cakephp 2.3.6 execute behavior callback in sequence on one more behavior?
for example, I have three behavior:
CustomBehavior1
CustomBehavior2
CustomBehavior3
and they ...
1
vote
1answer
37 views
CakePHP Parent/Child Association: confusion in creating records at the same time?
I will do my best to explain my situation in the hopes it will be clear enough for someone to help me out:
I currently have a 'Requests' model. This consists of a web form and a controller that ...
1
vote
2answers
26 views
Defining global conditions in Model
Is it possible to define global conditions for Model ?
I have 2 Models: User and Student. In database both of them are using table users but each student has set parent_id to its owner (which is set ...
0
votes
1answer
16 views
Validate associated models in CakePHP2
I'm a noob in CakePHP and I've been trying to do some complex validations here:
I have the following models:
- Fonts (name, file);
- Settings(value1,value2,value3,type_id,script_id);
- Types(name)
...
0
votes
1answer
40 views
CakePHP Join Model Issue
I have three relationships in my database, actions, action types and social media. Every action has an action type and the same action type can be shared by many actions. Also, every action belongs to ...
0
votes
1answer
29 views
Virtual Fields and model aliases
I'm newbie in cakephp and a I have the next problem:
Model: CostsCenter->Scholarship->ScholarshipsDetail
1. Virtual Field in Scholarship Model:
public $virtualFields = array(
'code' => ...
0
votes
0answers
56 views
CakePHP find() on HABTM association table with missing model
I'm building an e-commerce site using CakePHP 2.3.x that has a Product model associated with an Order model in a HABTM relationship and I'm using orders_products as my join table. I have all of the ...
0
votes
1answer
31 views
CakePHP - Re-imported model and (i18n) translate with empty strings
The problem is that I import a model.
App::import('Model', 'Carrier');
$this->Carrier = new Carrier;
And I re-import and instacing this model later. Normally it would work as well. However, this ...
0
votes
2answers
34 views
cakephp setting select options and values at Model
In my database model, my attribute is set as type INT.
On the front end, I want to display a select field with representative values for the respective Integer values.
eg: [1 = Home, 2 = About]
I ...
0
votes
0answers
23 views
Returning a contained result in a hasMany find in CakePHP 2.x
I have a pretty straightforward Model relationship: a POST hasMany COMMENTs.
They're both correctly related to each other and they both have the Containable attribute turned on.
Is there any way to ...
0
votes
1answer
17 views
Manual JOIN on CakePHP
I'm trying to do manual join because I expected to get better query result than CakePHP did.
This is my controller's coding
$this->ClinicWishList->contain();
$this->set('recordSets', ...