6 answers
2 votes
What do you think of my Validation tool?
I got frustrated with long complicated validation rules in my models, and the limited functionality of Bake's validation generation, so I made my own tool. If I get enough support I will clean it up, make it pretty, and probably get it its own...
1 answer
0 votes
Creating schemas for models on different databases
Hi,
Here's my question, I was able to create schemas a few months ago but stopped because I made some custom models for tables on a different database, and for this particular example, a PHPBB surrogate model under the main app, same database...
1 answer
0 votes
Multi-model validation while $persistModel = true
I'm getting close to being finished on my site, and so after looking up ways of speeding up my site I found a tip to make $persistModel = true in my AppController. This seems to be working fine, until I need some multi-model validation.
I've got a...
4 answers
1 vote
ClassRegistryクラス についてはどこで学べますか?
Controller や Model で、動的にModelを呼ぶときは、ClassRegistry::init()が良いと言われていますが、それについての情報があまり見つかりません。
使い方は、以下の通り簡単なので、問題ないのですが、ClassRegistoryクラス全般についての理解を深めたいと思っています。
どこかにまとまっていたりしますか?
$User = ClassRegistry::init('User');
$users =... 2 answers
1 vote
"Bake" validations differences between Name and Title fields
I don't know if any of you have already noticed this, but when we're baking a model in the Cake Bake console, there is a subtle differences for default validations between fields named "name" and "title":
name : the default selected validation...
3 answers
-2 votes
Validation: Difference between allowEmpty flag and notEmpty rule
I was reading the Cookbook tonight and I noticed that there are comparisons for the "required" flag and "notEmpty" rule, and the "allowEmpty" flag and the "required" flag...
But no comparison for the "allowEmpty" flag and "notEmpty" rule.
So the...
2 answers
0 votes
How can I access from one model another model?
How can I access from one model another model?
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(!)...
2 answers
0 votes
model query
Hii developers,
This is my normal sql query,
select id,title from library_items where library_items.id not in
(select issue_library_items.library_item_id from issue_library_items
where return_date is null);
Can anybody give me the corresponding...
1 answer
0 votes
Update a model entry without changing "modified"?
How can I update a entry in a model without updating the "modified" setting?
2 answers
0 votes
Validation Rules: between and minLength != required?
While following some of the beginner tutorials, and playing around with CakePHP, I noticed that on the CRUD pages generated from the Cake console, the Create page would list many fields as bold, and many as normal text. A Google search told me,...
0 answers
0 votes
Undefined property help :(
i have a problem with add action help me.
i used
cake bake all
http://localhost/loan/AjiltanBrts looks Ok
http://localhost/loan/AjiltanBrts/add
Notice (8): Undefined property: AjiltanBrt::$BankSalLav [APP\controllers\ajiltan_brts_controller.php,...
1 answer
0 votes
Auto converting data from a datetime field to a specific format in CakePHP
Hi is possible to format (using date()) all data from a datetime field in CakePHP? I'm thinking about using a callback function in the model but I don't know if I could filter fields coming from a datetime type.
Thanks in advance!
1 answer
1 vote
How do I add a derived column to a model?
Example:
part table has these fields
id
description
model
partnumber
input
output
pdffile1
pdffile2
What we need is to be able to add
a field that mimics the regular sql case command
(case when input=5 then pdffile1 else pdfdile2 end) as whichpdf
how do we...
1 answer
2 votes
User and Friends Relationship
Im trying to work out how to best setup a friends relation for each user to have and belong to many friends and there will be system to send a friend request and for the other user to accept or deny.
I have looked around for an article talking...
1 answer
0 votes
using model in components
I'm using CakePHP 1.1
Im trying to save data in a table but i got this error
Notice: Undefined property: AttendanceComponent::$AttendanceCache in C:\wamp\www\mpk\app\plugins\attendance\controllers\components\attendance.php on line 368
Fatal error:...
1 answer
0 votes
Using Google Calendar/Docs as a data source?
Is it possible to use Google Calendar as a data source? I'm not sure how this would work: either the model connects to GC instead of the database, or a plugin or something abstracts the needed behavior?
Similarly, is it possible to use Google...
1 answer
0 votes
Defining Model Relations for ACL Interface (gui) with CakePHP
Hello,
I have set up Auth and ACL successfully on my cakePHP app.
How, now i want to build an interface for managing the ACL's, ARO's and ACO's
ARO's and ACO's where pretty easy to build using the tree behavior.
ACL how ever got me a little messed...
1 answer
0 votes
How to avoid issues using Models and Components with the same name?
Is there any other solution than renaming the Model Class to avoid model & component name collision on the Controller?
1 answer
1 vote
How to add data from model to model
hii,
I have a Member model. From this member i want to insert data to tables, homeaddresses. What should i do with homeaddresses model. Homeaddresses hava only Model. No controller and view. How is possible to add data to the table from...