__construct() public method

Constructor
public __construct ( )
Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * @param   \Scalr_Environment  $env           The environment
  * @param   string              $ccId          The identifier of the cost center which is assigned
  * @param   string              $oldCcId       The identifier of the old cost center which is replaced
  */
 public function __construct(Scalr_Environment $env, $ccId, $oldCcId)
 {
     parent::__construct();
     array_push($this->ccs, $ccId, $oldCcId);
     $ccName = AccountTagEntity::fetchName($ccId, TagEntity::TAG_ID_COST_CENTRE);
     $oldCcName = AccountTagEntity::fetchName($oldCcId, TagEntity::TAG_ID_COST_CENTRE);
     $this->message = sprintf("User %s replaced cost center '%s' with '%s' in the enviroment '%s' id:%d", strip_tags($this->getUserEmail()), strip_tags($oldCcName), strip_tags($ccName), strip_tags($env->name), $env->id);
     $this->messageToHash = sprintf('%s|%s|%s|%s|%s', $this->timelineEvent->dtime->format('Y-m-d'), $oldCcId, $ccId, $env->id, $this->getUserEmail());
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param   \DBFarm    $farm          The DBFarm instance
  * @param   string     $projectId     The uuid of the project
  */
 public function __construct(DBFarm $farm, $projectId)
 {
     parent::__construct();
     $projectEntity = ProjectEntity::findPk($projectId);
     $this->projects[] = $projectId;
     if ($projectEntity) {
         $this->ccs[] = $projectEntity->ccId;
         $projectName = $projectEntity->name;
     } else {
         $projectName = AccountTagEntity::fetchName($projectId, TagEntity::TAG_ID_PROJECT);
     }
     $this->message = sprintf("User %s assigned a new farm '%s' id:%d to the project '%s'", strip_tags($this->getUserEmail()), strip_tags($farm->Name), $farm->ID, strip_tags($projectName));
     $this->messageToHash = sprintf('%s|%s|%s|%s', $this->timelineEvent->dtime->format('Y-m-d'), $this->getUserEmail(), $farm->ID, $projectId);
 }
Ejemplo n.º 3
0
 /**
  * Constructor
  *
  * @param   \DBFarm    $farm              The DBFarm instance
  * @param   string     $projectId         The identifier of the project to assign
  * @param   string     $oldProjectId      The identifier of the old project which is replaced
  */
 public function __construct(DBFarm $farm, $projectId, $oldProjectId)
 {
     parent::__construct();
     array_push($this->projects, $projectId, $oldProjectId);
     $projectEntity = ProjectEntity::findPk($projectId);
     if ($projectEntity) {
         $this->ccs[$projectEntity->ccId] = $projectEntity->ccId;
         $projectName = $projectEntity->name;
     } else {
         $projectName = AccountTagEntity::fetchName($projectId, TagEntity::TAG_ID_PROJECT);
     }
     $oldProjectEntity = ProjectEntity::findPk($oldProjectId);
     if ($oldProjectEntity) {
         $this->ccs[$oldProjectEntity->ccId] = $oldProjectEntity->ccId;
         $oldProjectName = $oldProjectEntity->name;
     } else {
         $oldProjectName = AccountTagEntity::fetchName($oldProjectId, TagEntity::TAG_ID_PROJECT);
     }
     $this->message = sprintf("User %s replaced project '%s' with project '%s' in the farm '%s' id:%d", strip_tags($this->getUserEmail()), strip_tags($oldProjectName), strip_tags($projectName), strip_tags($farm->Name), $farm->ID);
     $this->messageToHash = sprintf('%s|%s|%s|%s|%s', $this->timelineEvent->dtime->format('Y-m-d'), $this->getUserEmail(), $oldProjectId, $projectId, $farm->ID);
 }