Actually I tried, but I'm not sure if I did it correctly. Here's my
model:

<?php
class Group extends AppModel {
  var $name = 'Group';
//   var $useTable = 'aros';
  var $useTable = false;
  var $_schema = array(
    'id' => array(
      'type' => 'integer',
      'key' => 'primary',
      'length' => 11
    ),
    'parent' => array(
      'type' => 'integer',
      'length' => 11
    ),
    'alias' => array(
      'type' => 'string',
      'length' => 255
    )
  );
  var $validate = array(
    'alias' => array(
      'alphaNumeric' => array(
        'rule' => 'alphaNumeric',
        'message' => 'Pole zawiera niedozwolone znaki'
      ),
      'notEmpty' => array(
        'rule' => 'notEmpty',
        'message' => 'Pole nie może być puste',
      ),
      'between' => array(
        'rule' => array('between', 5, 255),
        'message' => 'Pole musi zawierać od 5 do 255 znaków',
      )
    ),
    'parent' => array(
      'notEmpty' => array(
        'rule' => 'notEmpty',
        'message' => 'Pole nie może być puste',
      )
    )
  );



}


On 21 Lip, 18:28, Nabil Alsharif <bli...@gmail.com> wrote:
> Try setting the $schema variable in the model.
>
>
>
> On Wed, Jul 21, 2010 at 8:55 AM, Xander <a.ciesiolkiew...@gmail.com> wrote:
> > Hello.
> > I'm developing applications with user's and content's groups based on
> > ACL trees.
> > In my app I have 2 models without any tables. Models are used because
> > I want to use automatic validation. First model is for
> > ContactsController. There is no table used, so I set Contact::
> > $useTable to false and everything is working just fine.
> > Second model is used to validate the GroupsController edit form. After
> > validation ACL's Aco Tree or both Aro and Aco Trees are updated (users
> > are in both trees, contents in aco only) using separate Aco and Aro
> > objects. I set useTable to false here too, but when using $this->Group-
> >>validates() Cake yells "Table ncube.groups doesn't exist (...)
> > Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group`   WHERE
> > `Group`.`id` = '7'   ". I don't know if it's important but my table
> > prefix is also ignored here. There was no warning when Group::
> > $validate was an empty array.
> > As a work around I put '@' before $this->Group->validates() .
> > The controller itself is working just fine. Data are validated and
> > saved properly. I don't know where to look for bugs.
>
> > P.S. Sorry for my english.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to