/** * Constructor. * * @param string $name The name of the KPI which is used in the log files, must only be letters and/or numbers. * * @throws Alpha\Exception\IllegalArguementException * * @since 1.1 */ public function __construct($name) { $config = ConfigProvider::getInstance(); $this->name = new String(); $this->name->setRule(Validator::REQUIRED_ALPHA_NUMERIC); $this->name->setHelper('The KPI name can only contain letters and numbers'); $this->name->setValue($name); $this->timeStamp = new Timestamp(date('Y-m-d H:i:s')); $this->startTime = microtime(true); $sessionProvider = $config->get('session.provider.name'); $session = SessionProviderFactory::getInstance($sessionProvider); // a startTime value may have been passed from a previous request if ($session->get($name . '-startTime') !== false) { $this->startTime = $session->get($name . '-startTime'); $session->delete($name . '-startTime'); } $this->sessionID = $session->getID(); }
/** * Setter for displayName. * * @param string $displayName * * @since 1.0 */ public function setDisplayName($displayName) { $this->displayName->setValue($displayName); }