本文整理汇总了PHP中AbstractTable类的典型用法代码示例。如果您正苦于以下问题:PHP AbstractTable类的具体用法?PHP AbstractTable怎么用?PHP AbstractTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AbstractTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setTable
/**
* Sets the primary table name and retrieves the table schema.
*
* @param \Zend\Db\Table\AbstractTable $adapter
* @return \Zend\Db\Select This \Zend\Db\Select object.
*/
public function setTable(AbstractTable $table)
{
$this->_adapter = $table->getAdapter();
$this->_info = $table->info();
$this->_table = $table;
return $this;
}
示例2: _prepareReference
/**
* Prepares a table reference for lookup.
*
* Ensures all reference keys are set and properly formatted.
*
* @param \Zend\Db\Table\AbstractTable $dependentTable
* @param \Zend\Db\Table\AbstractTable $parentTable
* @param string $ruleKey
* @return array
*/
protected function _prepareReference(AbstractTable $dependentTable, AbstractTable $parentTable, $ruleKey)
{
$parentTableName = get_class($parentTable) === 'Zend_Db_Table' ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
$map = $dependentTable->getReference($parentTableName, $ruleKey);
if (!isset($map[AbstractTable::REF_COLUMNS])) {
$parentInfo = $parentTable->info();
$map[AbstractTable::REF_COLUMNS] = array_values((array) $parentInfo['primary']);
}
$map[AbstractTable::COLUMNS] = (array) $map[AbstractTable::COLUMNS];
$map[AbstractTable::REF_COLUMNS] = (array) $map[AbstractTable::REF_COLUMNS];
return $map;
}
示例3: __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'];
}
示例4: prepareQuery
public function prepareQuery()
{
parent::prepareQuery();
$this->query .= " where name='website' OR name='link'";
if (isset($this->name) && !empty($this->name)) {
$this->query .= " OR name = '" . $this->name . "';";
}
}
示例5: catch
function __construct()
{
try {
parent::__construct();
} catch (ADODB_Exception $e) {
throw new Exception("Database Connection Error");
}
}
示例6: 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();
}
示例7: save
public function save($new = false)
{
if (parent::save($new)) {
$_SESSION['usr']['upd'] = 1;
return true;
} else {
return false;
}
}
示例8: __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);
}
示例9: 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();
}
示例10: bind
/**
* Added to filter dates to SQL format
*
* @param mixed $array
* @param array $ignore
* @return $this
*/
public function bind($array, $ignore = array())
{
//transform date to SQL
if (!empty($array['start_date'])) {
$array['start_date'] = $this->dateToSql($array['start_date']);
}
if (!empty($array['end_date'])) {
$array['end_date'] = $this->dateToSql($array['end_date']);
}
return parent::bind($array, $ignore);
}
示例11: __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'];
}
示例12: __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'];
}
示例13: __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);
}
}
示例14: addColumnObject
/** {@inheritdoc} */
public function addColumnObject($column)
{
// PostgreSQL creates columns without comment. Adjust $column so that
// setComment() knows that it must still be added.
$comment = $column->getComment();
$column->setComment(null);
$newColumn = parent::addColumnObject($column);
if ($comment) {
$newColumn->setComment($comment);
$column->setComment($comment);
}
return $newColumn;
}
示例15: __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;
}
}