Questions tagged with model

6 answers

2 votes

Asked by trevorsg, on 30/10/09 in

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

Asked by ojtibi, on 30/10/09 in

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

Asked by TheWorldofDan, on 1/11/09 in

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

Asked by monsat, on 13/11/09 in

ClassRegistryクラス についてはどこで学べますか?

Controller や Model で、動的にModelを呼ぶときは、ClassRegistry::init()が良いと言われていますが、それについての情報があまり見つかりません。

使い方は、以下の通り簡単なので、問題ないのですが、ClassRegistoryクラス全般についての理解を深めたいと思っています。

どこかにまとまっていたりしますか?


$User = ClassRegistry::init('User');
$users =...

2 answers

1 vote

Asked by ojtibi, on 15/11/09 in

"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

Asked by ojtibi, on 15/11/09 in

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

Asked by powtac, on 18/11/09 in

How can I access from one model another model?

How can I access from one model another model?

3 answers

1 vote

Asked by powtac, on 18/11/09 in

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

Asked by jiransluke, on 26/11/09 in

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

Asked by powtac, on 26/11/09 in

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

Asked by Insomniaque, on 28/11/09 in

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

Asked by kani, on 29/11/09 in

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

Asked by ajushi.myopenid.com, on 4/12/09 in

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

Asked by rparkjr, on 4/12/09 in

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

Asked by Shard, on 7/12/09 in

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

Asked by odin88, on 9/12/09 in

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

Asked by plokiju, on 10/1/10 in

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

Asked by ken, on 10/12/09 in

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

Asked by Dominguez, on 10/12/09 in

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

Asked by jiransluke, on 11/12/09 in

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...

<< previous 1   2   3   4   5   6   7   8   9