本文整理汇总了PHP中AbstractTable::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractTable::__construct方法的具体用法?PHP AbstractTable::__construct怎么用?PHP AbstractTable::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractTable
的用法示例。
在下文中一共展示了AbstractTable::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* Instantiate a TTF 'maxp' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Maxp
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
parent::__construct($this->allowed);
$bytePos = $font->tableInfo['maxp']->offset + 4;
$ary = unpack('nnumberOfGlyphs/', $font->read($bytePos, 2));
$this->numberOfGlyphs = $ary['numberOfGlyphs'];
}
示例2: catch
function __construct()
{
try {
parent::__construct();
} catch (ADODB_Exception $e) {
throw new Exception("Database Connection Error");
}
}
示例3: __construct
/**
* Constructor
*
* Instantiate a TTF 'cmap' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Cmap
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
parent::__construct($this->allowed);
$bytePos = $font->tableInfo['cmap']->offset;
// Get the CMAP header data.
$cmapTableHeader = unpack('ntableVersion/' . 'nnumberOfTables', $font->read($bytePos, 4));
$this->header = new \ArrayObject($cmapTableHeader, \ArrayObject::ARRAY_AS_PROPS);
$this->parseSubTables($font);
}
示例4: sprintf
function __construct($t_cust_account_id)
{
if (!empty($t_cust_account_id)) {
$this->fromClause = sprintf($this->fromClause, "and a.t_cust_account_id = " . $t_cust_account_id);
} else {
$this->fromClause = sprintf($this->fromClause, 'and a.t_cust_account_id = -999');
}
parent::__construct();
}
示例5: sprintf
function __construct($role_id = '')
{
if (!empty($role_id)) {
$this->role_id = (int) $role_id;
$this->fromClause = sprintf($this->fromClause, 'AND p_role_menu.role_id = ' . $this->role_id);
} else {
$this->fromClause = sprintf($this->fromClause, '');
}
parent::__construct();
}
示例6: __construct
/**
* Constructor
*
* Instantiate a TTF 'post' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Post
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
parent::__construct($this->allowed);
$bytePos = $font->tableInfo['post']->offset + 4;
$italicBytes = $font->read($bytePos, 4);
$this->italicAngle = $font->readFixed(16, 16, $italicBytes);
$bytePos += 8;
$ary = unpack('nfixed/', $font->read($bytePos, 2));
$ary = $font->shiftToSigned($ary);
$this->fixed = $ary['fixed'];
}
示例7: __construct
/**
* Constructor
*
* Instantiate a TTF 'hhea' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Hhea
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
parent::__construct($this->allowed);
$bytePos = $font->tableInfo['hhea']->offset + 4;
$ary = unpack('nascent/' . 'ndescent', $font->read($bytePos, 4));
$ary = $font->shiftToSigned($ary);
$this->ascent = $font->toEmSpace($ary['ascent']);
$this->descent = $font->toEmSpace($ary['descent']);
$bytePos = $font->tableInfo['hhea']->offset + 34;
$ary = unpack('nnumberOfHMetrics/', $font->read($bytePos, 2));
$this->numberOfHMetrics = $ary['numberOfHMetrics'];
}
示例8: __construct
/**
* Constructor
*
* Instantiate a TTF 'loca' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Loca
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
parent::__construct($this->allowed);
$bytePos = $font->tableInfo['loca']->offset;
$format = $font->header->indexToLocFormat == 1 ? 'N' : 'n';
$byteLength = $font->header->indexToLocFormat == 1 ? 4 : 2;
$multiplier = $font->header->indexToLocFormat == 1 ? 1 : 2;
for ($i = 0; $i < $font->numberOfGlyphs + 1; $i++) {
$ary = unpack($format . 'offset', $font->read($bytePos, $byteLength));
$this->offsets[$i] = $ary['offset'] * $multiplier;
$bytePos += $byteLength;
}
}
示例9: __construct
/**
* Constructor
*
* Instantiate a TTF 'hmtx' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Hmtx
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
parent::__construct($this->allowed);
$bytePos = $font->tableInfo['hmtx']->offset;
for ($i = 0; $i < $font->numberOfHMetrics; $i++) {
$ary = unpack('nglyphWidth/', $font->read($bytePos, 2));
$this->glyphWidths[$i] = $font->shiftToSigned($ary['glyphWidth']);
$bytePos += 4;
}
while (count($this->glyphWidths) < $font->numberOfGlyphs) {
$this->glyphWidths[] = end($this->glyphWidths);
}
}
示例10: __construct
/**
* Constructor
*
* Instantiate a TTF 'name' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Name
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
$font->tableInfo['name']->header = new \ArrayObject(unpack('nformatSelector/' . 'nnameRecordsCount/' . 'nstorageOffset', $font->read($font->tableInfo['name']->offset, 6)), \ArrayObject::ARRAY_AS_PROPS);
$bytePos = $font->tableInfo['name']->offset + 6;
for ($j = 0; $j < $font->tableInfo['name']->header->nameRecordsCount; $j++) {
$ttfRecord = unpack('nplatformId/' . 'nencodingId/' . 'nlanguageId/' . 'nnameId/' . 'nlength/' . 'noffset', $font->read($bytePos, 12));
$ttfRecordOffset = $bytePos + 12;
$nextBytePos = $font->tableInfo['name']->offset + $font->tableInfo['name']->header->storageOffset + $ttfRecord['offset'];
$ttfValue = $font->read($nextBytePos, $ttfRecord['length']);
if ($ttfRecord['platformId'] != 1) {
$ttfValue = @iconv('UTF-16be', 'UTF-8//TRANSLIT', $ttfValue);
}
if ($ttfValue != '' && isset($ttfRecord['nameId']) && isset($this->names[$ttfRecord['nameId']])) {
$this->allowed[$this->names[$ttfRecord['nameId']]] = $ttfValue;
}
$bytePos = $ttfRecordOffset;
}
parent::__construct($this->allowed);
}
示例11: __construct
/**
* Constructor
*
* Instantiate a TTF 'head' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Head
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
$bytePos = $font->tableInfo['head']->offset;
$tableVersionNumberBytes = $font->read($bytePos, 4);
$tableVersionNumber = $font->readFixed(16, 16, $tableVersionNumberBytes);
$bytePos += 4;
$fontRevisionBytes = $font->read($bytePos, 4);
$fontRevision = $font->readFixed(16, 16, $fontRevisionBytes);
$versionArray = ['tableVersionNumber' => $tableVersionNumber, 'fontRevision' => $fontRevision];
$bytePos += 4;
$headerArray = unpack('NcheckSumAdjustment/' . 'NmagicNumber/' . 'nflags/' . 'nunitsPerEm', $font->read($bytePos, 12));
$bytePos += 28;
$bBox = unpack('nxMin/' . 'nyMin/' . 'nxMax/' . 'nyMax', $font->read($bytePos, 8));
$bBox = $font->shiftToSigned($bBox);
$bytePos += 14;
$indexToLocFormat = unpack('nindexToLocFormat', $font->read($bytePos, 2));
$headerArray['indexToLocFormat'] = $font->shiftToSigned($indexToLocFormat['indexToLocFormat']);
$this->allowed = array_merge($versionArray, $headerArray, $bBox);
parent::__construct($this->allowed);
}
示例12: __construct
/**
* __construct() - For concrete implementation of Zend_Db_Table
*
* @param string|array $config string can reference a \Zend\Registry key for a db adapter
* OR it can reference the name of a table
* @param array|\Zend\Db\Table\Definition $definition
*/
public function __construct($config = array(), $definition = null)
{
if ($definition !== null && is_array($definition)) {
$definition = new Definition($definition);
}
if (is_string($config)) {
if (\Zend\Registry::isRegistered($config)) {
trigger_error(__CLASS__ . '::' . __METHOD__ . '(\'registryName\') is not valid usage of Zend_Db_Table, ' . 'try extending Zend_Db_Table_Abstract in your extending classes.', E_USER_NOTICE);
$config = array(self::ADAPTER => $config);
} else {
// process this as table with or without a definition
if ($definition instanceof Definition && $definition->hasTableConfig($config)) {
// this will have DEFINITION_CONFIG_NAME & DEFINITION
$config = $definition->getTableConfig($config);
} else {
$config = array(self::NAME => $config);
}
}
}
parent::__construct($config);
}
示例13: __construct
/**
* Constructor
*
* Instantiate a OTF 'OS/2' table object.
*
* @param \Pop\Pdf\Build\Font\TrueType $font
* @return Os2
*/
public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
{
parent::__construct($this->allowed);
$this->flags = new \ArrayObject(['isFixedPitch' => false, 'isSerif' => false, 'isSymbolic' => false, 'isScript' => false, 'isNonSymbolic' => false, 'isItalic' => false, 'isAllCap' => false, 'isSmallCap' => false, 'isForceBold' => false], \ArrayObject::ARRAY_AS_PROPS);
$bytePos = $font->tableInfo['OS/2']->offset + 8;
$ary = unpack("nfsType", $font->read($bytePos, 2));
$this->embeddable = $ary['fsType'] != 2 && ($ary['fsType'] & 0x200) == 0;
$bytePos = $font->tableInfo['OS/2']->offset + 30;
$ary = unpack("nfamily_class", $font->read($bytePos, 2));
$familyClass = $font->shiftToSigned($ary['family_class']) >> 8;
if ($familyClass >= 1 && $familyClass <= 5 || $familyClass == 7) {
$this->flags->isSerif = true;
} else {
if ($familyClass == 8) {
$this->flags->isSerif = false;
}
}
if ($familyClass == 10) {
$this->flags->isScript = true;
}
if ($familyClass == 12) {
$this->flags->isSymbolic = true;
$this->flags->isNonSymbolic = false;
} else {
$this->flags->isSymbolic = false;
$this->flags->isNonSymbolic = true;
}
// Unicode bit-sniffing may not be necessary.
$bytePos += 3;
$ary = unpack('NunicodeRange1/' . 'NunicodeRange2/' . 'NunicodeRange3/' . 'NunicodeRange4', $font->read($bytePos, 16));
if ($ary['unicodeRange1'] == 1 && $ary['unicodeRange2'] == 0 && $ary['unicodeRange3'] == 0 && $ary['unicodeRange4'] == 0) {
$this->flags->isSymbolic = false;
$this->flags->isNonSymbolic = true;
}
$bytePos = $font->tableInfo['OS/2']->offset + 76;
$ary = unpack("ncap/", $font->read($bytePos, 2));
$this->capHeight = $font->toEmSpace($font->shiftToSigned($ary['cap']));
}
示例14:
function __construct()
{
parent::__construct();
}
示例15:
/** {@inheritdoc} */
function __construct($database, $name)
{
$this->_informationSchemaColumns[] = 'COL_DESCRIPTION(table_name::REGCLASS::OID, ordinal_position) AS comment';
parent::__construct($database, $name);
}