Peter Hodge wrote:

No, it's very much KISS (to use), and yes, it was done through inheritance.  It
looks something like this:
// ORM class for the table 'dogs'
  class Table_dogs extends MyORM_Table {
    var $table = 'dogs';
    var $primary = 'DogID';

    function __construct() {
      parent::__construct();

      // if user is not 'super', only allow certain breeds
      global $user;
      if(!$user->isSuperUser()) {
        // JOIN breeds USING(DogID)
        $this->join('breeds')->using('DogID');

        // only allow the correct certain breeds:
        $this->where("breeds.BreedID IN({$user->breeds()})");
      }
    }
  }


I can't think of an easier way to add blanket rules which apply to an entire
project.

regards,
Peter

Hi Peter.

Possibly, in *your* case, this could be a good decision. But, at least, it breaks the Single Responsibility Principle, and I'm quite sure that code responsible for ACL features will need to be duplicated every time you'd want to use those features.

PS. I also think this discussion does not fall into "KISS ORM system upon Zend_Db_Table" thread.

Best regards,

Victor

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to