gyro/core/behaviour/commands/generics/cookie.set.cmd.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Sets a Cookie 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup Behaviour 00007 */ 00008 class CookieSetCommand extends CommandBase { 00009 protected $name; 00010 protected $data; 00011 protected $duration; 00012 00013 public function __construct($name, $data, $duration) { 00014 $this->name = $name; 00015 $this->data = $data; 00016 $this->duration = $duration; 00017 } 00018 00019 // ************************************ 00020 // ICommand 00021 // ************************************ 00022 00023 /** 00024 * Executes commands 00025 * 00026 * @return Status 00027 */ 00028 public function execute() { 00029 Cookie::create($this->name, $this->data, $this->duration); 00030 return parent::execute(); 00031 } 00032 00033 /** 00034 * Returns title of command. 00035 */ 00036 public function get_name() { 00037 return 'cookie.set'; 00038 } 00039 }