Skip to content

caztial/php-user-role-design-pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

php-user-role-design-pattern

Object Oriented Design Pattern to address Role Based User Management for PHP or any other OOP language

You will need previous understanding about Strategy, Decorator, Singleton and Factory design pattern to understand the design.

I have added basic object creation in my index.php to get you started..

Class Diagram Class-Diagram

I’m still learning design patterns and I’m not 100% correct, Improvements and Enhancements are welcome.

Sample var_dump of a Admin object

object(Admin)#5 (4) {
  ["admin"]=>
  string(9) "Admin Obj"
  ["user"]=>
  object(Customer)#4 (4) {
    ["customer"]=>
    string(12) "Customer Obj"
    ["user"]=>
    object(Visitor)#3 (3) {
      ["Visitor"]=>
      string(11) "Visitor Obj"
      ["communication"]=>
      object(Email)#2 (0) {
      }
      ["dbms"]=>
      object(Mysql)#1 (0) {
      }
    }
    ["communication"]=>
    object(Email)#2 (0) {
    }
    ["dbms"]=>
    object(Mysql)#1 (0) {
    }
  }
  ["communication"]=>
  object(Email)#2 (0) {
  }
  ["dbms"]=>
  object(Mysql)#1 (0) {
  }
}

Speical thanks to www.genmymodel.com

About

Object Oriented Design Pattern to address Role Based User Managment for PHP or any other OOP language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages