I need a little assistance with a join over 3 tables.
I have the following Models (User > Profile > Infogroup >
Information):
- User (hasMany Profile)
- Profile (belongsTo User, hasMany Infogroup)
- Infogroup (belongsTo Profile, hasMany Information)
- Information (belongsTo Infogroup)
The relati
Hello
I have a login procedure that requires more information than just the
username and password.
Controller: "employees"
Action: "login"
Databasefields needed for login: email, password, group (because it is
possible to have the same email for different groups).
Login URL: http://mydomain.co
> Array
> (
> [comment] => Comment 1
> [user_id] => 1
> )
> [1] => Array
> (
> [comment] => Comment 2
> [user_id] => 2
> )
>
I cannot get the $fieldList to work for Model->saveAll() not matter
what I try.
How should the $fieldList array be formatted when storing a Model plus
associated Models via saveAll()?
My example:
Form fields:
User.first_name
User.last_name
Address.street
Address.city
...
The two models User an
It seems to me, that if you're not logged in OR if you are not
authorized for a specific action, you will receive the same message
($this->Auth->authError in the Controller).
I would, however, prefer two different messages. I.e. "Please login"
if not logged in at all, or "Not authorized" if logge
I suspect this to be a pretty common thing to do, so I hope someone
can let me know how ;-)
On May 24, 11:22 pm, Teh Treag wrote:
> jakobip,
>
> What do you have $this->Event->recursive set to? Are the associations
> done correctly?
>
> -teh
>
> On May 24, 9:12 a
Im having a problem with the $fieldList parameter for my User model's
save() method:
(in users_controller)
$this->data['User']['password_confirm_hashed'] = $this->Auth->password
($this->data['User']['confirm_password']);
$fieldList = array(
'first_name',
'last_name',
'email',
'password',
lor = $this->data['Apple']['color'];
> }
> return $colour == 'red';
>
> }
>
> -Mark
>
> On May 23, 9:59 am, jakobjp wrote:
>
>
>
> > I've read a few discussions about CakePHP returning objects vs.
> > arrays, a
Hmm, I'm not sure I follow the example. At least it didn't help we to
resolve this - probably because of lacking skills on my part :-(
When I add the following afterFind() function to my Event method...
function afterFind($events) {
foreach ($events AS $event) {
pr($event);
}
}
... I wo
I have a model Event that hasMany Ticket.
Ticket has a field called "price".
I would like to accomplish that Event gets an attribute
"total_ticket_price", which is the sum of "price" for all of Event's
Tickets.
I have been trying to looking into the afterFind() method, but I have
been unable to
I've read a few discussions about CakePHP returning objects vs.
arrays, and this is NOT intended to be such. I just have a question,
related to it:
I used to have (i.e. "before CakePHP") objects like this:
class Apple {
var $color;
var $sweet;
function __construct($id = false) {
if ($i
3 pm, brian wrote:
> I suppose the burning question is, why do you want both versions of
> the app using the same DB? That seems fraught with peril.
>
>
>
> On Mon, Apr 20, 2009 at 11:03 AM, jakobjp wrote:
>
> > I am trying to map model attributes to database fields
Another way of describing the problem is that instead of having the
following query style:
SELECT uid, firstname FROM users;
I want this query style:
SELECT uid AS id, firstname AS first_name FROM users;
So that I can use the attributes "id" and "first_name" in the code,
but it will work with th
I am trying to map model attributes to database fields with different
names.
Example of regular CakePHP model:
User Model with attributes "id" and "firstname" would load the
appropriate values from same-named database fields "id" and
"firstname".
Example of my CakePHP mode:
User Model with aatri
I have a list of articles. One of the columns shows an aggregate
field, which is the average rating of the article.
Problem: The list only shows articles that have at least one rating.
The SQL query generated by CakePHP is not considering articles that
have no rating at all.
The function in the
I'm trying to figure out how to create a system that can handle the
following:
Models: user, post, category
Roles: regular, moderator, admin
- User ("regular user") can create posts in categories.
- User ("regular user") can edit own posts.
- Multiple users can have the role "moderator" in mult
This is weird: I can successfully change the language with $this-
>Session->write('Config.language', 'fr'); in the beforeRender()
function in apps_controller.php
Why does it not work in beforeFilter()?
Does it matter where it's being done?
On Mar 10, 2:09 pm,
On Mar 10, 2:25 am, "jitka (poLK)" wrote:
> > I have created two test languages in:
> > /app/locale/eng/LC_MESSAGES/default.php
> > /app/locale/fre/LC_MESSAGES/default.php
>
> php extension is reason. CakePHP assumes there plaintext .po (or
> preferrable binary .mo) files.
Yeah that was a mist
Unfortunately that didn't do the trick... :-(
On Mar 10, 1:42 am, Miles J wrote:
> I use app import and it worked for me:
>
> App::import('Core', 'l10n');
> $l10n = new L10n();
> $l10n->get($locale);
>
> I also place it in my app controller beforeFilter(). If you are doing
> it in another contro
've been reading a lot about l10n in cakephp now, but there seems to
be some
confusion about what is the correct way to use languages...
I have created two test languages in:
/app/locale/eng/LC_MESSAGES/default.php
/app/locale/fre/LC_MESSAGES/default.php
I am displaying my test string in a view
20 matches
Mail list logo