VALID_NOT_EMPTY); var $belongsTo = array( 'CakeGroup' => array( 'className' => 'CakeGroup', 'foreignKey' => 'group_id' ) ); /* * Function now meets Cake standards and best practices * Thanks to Mariano Iglesias for suggestion */ function getRules( $groupId = '(-1)') { $conditions = "CakeRule.group_id IN {$groupId}"; $fields = 'CakeRule.rulenum, CakeRule.action, CakeRule.allow '; $order = 'CakeRule.group_id ASC, CakeGroup.security_level DESC, CakeRule.rulenum ASC'; $data = $this->findAll( $conditions, $fields, $order, null, 1, 0); return $data; } } ?>