本文整理汇总了PHP中Part::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Part::__construct方法的具体用法?PHP Part::__construct怎么用?PHP Part::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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: __construct
/**
* 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: __construct
/**
* 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: __construct
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: __construct
public function __construct($stream, $messageNumber, $partNumber = null, $structure = null)
{
parent::__construct($stream, $messageNumber, $partNumber, $structure);
}
示例6: __construct
public function __construct($rawmessage = '')
{
$this->date = time();
parent::__construct($rawmessage);
}
示例7: __construct
/**
* 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: __construct
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: __construct
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']);
}
示例10: __construct
public function __construct($part_no)
{
parent::__construct($part_no, array());
$this->_details = $this->fetchDetails();
$this->setPricing($this->_details['display']);
}