Questions tagged with models

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

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

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

0 answers

0 votes

Asked by georlitz, on 11/12/09 in

What is the use of the AcoAction model?

I'm working on coding up a nice interface for adding/removing ACOs, and granting/revoking permissions on them for the AROs in my database. I have a functioning system, but it definitely could use some polishing.

With that context in mind, what is...

2 answers

0 votes

Asked by Max, on 16/12/09 in

including models in a stand alone class

I'm new to cakePHP and MVC so please bare with me. I want to create a class that can access the models but I don't know how. I tried a few things but it looks like the only way of loading one into a class is with $this-loadModel('modelname'); But...

2 answers

0 votes

Asked by kyleb, on 19/12/09 in

Newb question: Building an index on a DB with crappy naming conventions

I'm trying to understand how to build an index in CakePHP without using scaffolding. Keep in mind that the database I am working with has tables that are in all caps and are not pluralized - example table names would be USER, VISIT, VISIT_DATA,...

2 answers

0 votes

Asked by doobster, on 21/12/09 in

Dynamic Validation Text

I'm using a custom function to perform validation of a date. Inside that function I have about 4 different things I'm validating on.

Is it possible to get a custom message displayed based on where it fails validation in that function.

I tried...

1 answer

0 votes

Asked by tanissian, on 23/12/09 in

Correct data format for "required" validation flag

Hi all,

I have been reading posts on the confusion over "required" flag and I think I understand it pretty well.

However I am having problem trying to make it work.

For example, here is my...

1 answer

0 votes

Asked by makecakebake, on 23/12/09 in

HABTM to hasMany

I have various HABTM( 7 in total) tables for the user Profile Model. This creates numerous join_tables and was wondering if i made a generic skills model and loaded all of my skills into it with skillset_id to group the skills into sections....

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