protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
-
- // Set description
- $this->setObjectDescription("A shipping company class");
-
- // Generate unique ID number
- $this->generateUniqueId();
-
- // Clean up a little
- $this->removeSystemArray();
}
/**
// Does the given user owns a company?
if ($companyInstance->ifUserParticipatesInCompany($userInstance)) {
- // Then do some nastly caching here but don't throw an exception
+ // Then do some nasty caching here but don't throw an exception
// because then you will hurt our web helpers... :/
$companyInstance->partialStub("Don't throw exceptions here.");
} // END - if
// Make this person employed and give him some money to work
$employee->setEmployed(true);
- $employee->setObjectDescription($dummy->getObjectDescription());
$employee->setRealClass($dummy->__toString());
$employee->increaseSalary((mt_rand(7, 14) * 100)); // Are 700 to 1400 EUR for the begin okay?
$shipType
));
- // Debug message
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> baut in allen Werften bald Schiffe vom Typ <strong>%s</strong>.",
- __CLASS__,
- __LINE__,
- $this->getCompanyName(),
- $shipInstance->getObjectDescription()
- ));
-
// Iterate shipyard list
for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) {
// Get current element
// Validate the requested ship type with the company if they can construct it
public function validateWorksContractShipType (SignableContract $contractInstance) {
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> prüft den Bauauftrag der <strong>%s</strong>.",
- __CLASS__,
- __LINE__,
- $this->getCompanyName(),
- $contractInstance->getShipName()
- ));
-
// First get the ship type
$shipInstance = $contractInstance->getShipInstance();
// Get it's real class name
$shipType = $shipInstance->__toString();
- // Debug message
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> prüft, ob die <strong>%s</strong> (Typ:<strong>%s</strong>) gebaut werden kann.",
- __CLASS__,
- __LINE__,
- $this->getCompanyName(),
- $contractInstance->getShipName(),
- $shipInstance->getObjectDescription()
- ));
-
// Now check if the ship type is in any list and return the result
return ($this->isShipTypeConstructable($shipType));
}
// As a customer the shipping company can add new contracts
public function addNewWorksContract (SignableContract $contractInstance) {
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erstellt einen Bauauftrag für ein <strong>%s</strong> mit dem Namen <strong>%s</strong>.",
- __CLASS__,
- __LINE__,
- $this->getCompanyName(),
- $contractInstance->getShipInstance()->getObjectDescription(),
- $contractInstance->getShipInstance()->getShipName()
- ));
$this->contractList->append($contractInstance);
}