Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
software-dev-7054cem/staff.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
46 lines (34 sloc)
1.22 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" This is the entity, Staff""" | |
from messageboard import MessageController | |
from user_profile import Profile | |
class Staff(Profile): | |
def __init__(self): # a method to create objects | |
self.__email = "" | |
self.__role = "staff" | |
self.__managers = [] # Group of Four composite pattern | |
# Group of Four Composite Pattern | |
def add_manager(self, manager): | |
self.__managers.append(manager) | |
# self.__managers.append(manager) | |
def remove_manager(self, manager): | |
self.__managers.remove(manager) | |
def get_managers(self): | |
return self.__managers | |
def get_managers_email(self): | |
emails = [] | |
for member in self.__managers: | |
emails.append(member) | |
return emails | |
# ---------------------------------------------------- | |
def get_email(self): # get method | |
return self.__email | |
def set_email(self, mail): # set method | |
self.__email = mail | |
def get_role(self): | |
return self.__role | |
def set_role(self, role): | |
self.__role = role | |
# Group of Four: Mediator pattern applied to displayable messages | |
def send_message(self, message): | |
text = MessageController.display_message(message) | |
return text |