find with unrelated model

Dave
2009-06-30T04:40:55+00:00

 

I am trying to create a validation function where I check the
User.slug field against a tables of banned words

So if a user tries to use a slug "profile" it will come back invalid

I have Restrictions table with all banned words which is not related
to any model on the site.

How do I do a query from the users model to check restrictions table?

Tried App::Import('Model', 'Restriction'); method but all i get is
error -> Trying to get property of non-object
------------------------------------------

RE: find with unrelated model by Paul on 2009-06-30T05:27:17+00:00

$result = ClassRegistry::init('Restriction')->find('all', array('conditions'
=>array('Restriction.badword' =>$wordtotest)));


HTH,

Paul


to any model on the site.

How do I do a query from the users model to check restrictions table?

Tried App::Import('Model', 'Restriction'); method but all i get is
error -> Trying to get property of non-object


database 4198 (20090629) ------------------------------------------
Loading


$ This page is proudly powered by www.pubbs.net, you can see more at cakephp archive | Partners: ListWare Global Manufacturers