示例#1
0
 public function __construct($content = '', $filename = null, $contentType = 'application/octet-stream', $encoding = 'base64')
 {
     parent::__construct($content, $contentType, $encoding);
     $options = array();
     if ($filename !== null) {
         $options['name'] = $filename;
     }
     $this->setContentType($contentType, $options);
     $this->setContentDisposition($filename);
 }
示例#2
0
文件: Tabs.php 项目: zepi/turbo-base
 /**
  * Construct the object
  *
  * @access public
  * @param array $parts
  * @param array $classes
  * @param string $key
  * @param integer $priority
  * 
  * @throws \Zepi\Web\UserInterface\Exception Only Tab objects are allowd to add to a Tabs object.
  */
 public function __construct($parts = array(), $classes = array(), $key = '', $priority = 10)
 {
     parent::__construct(array(), $classes, $key, $priority);
     if (is_array($parts)) {
         foreach ($parts as $part) {
             if ($part instanceof \Zepi\Web\UserInterface\Layout\Tab) {
                 // Activate the first tab
                 if (count($this->parts) === 0) {
                     $part->setActive(true);
                 }
                 $this->addPart($part);
             } else {
                 throw new Exception('Only Tab objects are allowed to add to a Tabs object.');
             }
         }
     }
 }
示例#3
0
 /**
  * Public constructor
  *
  * In addition to the parameters of Part::__construct() this constructor supports:
  * - file  filename or file handle of a file with raw message content
  * - flags array with flags for message, keys are ignored, use constants defined in \Zend\Mail\Storage
  *
  * @param  string $rawMessage  full message with or without headers
  * @throws Exception
  */
 public function __construct(array $params)
 {
     if (isset($params['file'])) {
         if (!is_resource($params['file'])) {
             $params['raw'] = @file_get_contents($params['file']);
             if ($params['raw'] === false) {
                 throw new Exception\RuntimeException('could not open file');
             }
         } else {
             $params['raw'] = stream_get_contents($params['file']);
         }
     }
     if (!empty($params['flags'])) {
         // set key and value to the same value for easy lookup
         $this->_flags = array_combine($params['flags'], $params['flags']);
     }
     parent::__construct($params);
 }
示例#4
0
 public function __construct($part_no)
 {
     parent::__construct($part_no, array('Component' => 'grp', 'Amperage' => 'amps', 'Busway Type' => 'frame_type'));
     $this->_details = $this->fetchDetails();
     $this->setPricing($this->_details['display']);
 }
示例#5
0
 public function __construct($stream, $messageNumber, $partNumber = null, $structure = null)
 {
     parent::__construct($stream, $messageNumber, $partNumber, $structure);
 }
示例#6
0
文件: mail.php 项目: dapepe/tymio
 public function __construct($rawmessage = '')
 {
     $this->date = time();
     parent::__construct($rawmessage);
 }
示例#7
0
文件: Tab.php 项目: zepi/turbo-base
 /**
  * Construct the object
  *
  * @access public
  * @param array $parts
  * @param array $classes
  * @param string $key
  * @param string $name
  * @param integer $priority
  */
 public function __construct($parts = array(), $classes = array(), $key = '', $name = '', $priority = 10)
 {
     parent::__construct($parts, $classes, $key, $priority);
     $this->name = $name;
 }
示例#8
0
 public function __construct($part_no)
 {
     parent::__construct($part_no, array('Connection' => 'conn', 'Frame Type' => 'frame_type', 'Amperage' => 'amps', 'Poles' => 'poles', 'Voltage' => 'volts'));
     $this->_details = $this->fetchDetails();
     $this->setPricing($this->_details['display']);
 }
示例#9
0
 public function __construct($part_no)
 {
     parent::__construct($part_no, array('Amperage' => 'amps', 'Class' => 'class', 'Type' => 'fuse_subcategory.type'));
     $this->_details = $this->fetchDetails();
     $this->setPricing($this->_details['display']);
 }
示例#10
0
 public function __construct($part_no)
 {
     parent::__construct($part_no, array('KVA' => 'kva', 'Weight' => 'weight', 'Primary Voltage' => 'input_volts', 'Secondary Voltage' => 'output_volts'));
     $this->_details = $this->fetchDetails();
     $this->setPricing($this->_details['display']);
 }
示例#11
0
 public function __construct($part_no)
 {
     parent::__construct($part_no, array());
     $this->_details = $this->fetchDetails();
     $this->setPricing($this->_details['display']);
 }