本文整理汇总了PHP中Type::read方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::read方法的具体用法?PHP Type::read怎么用?PHP Type::read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: read
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 0:
if ($ftype == TType::MAP) {
$this->success = array();
$_size241 = 0;
$_ktype242 = 0;
$_vtype243 = 0;
$xfer += $input->readMapBegin($_ktype242, $_vtype243, $_size241);
for ($_i245 = 0; $_i245 < $_size241; ++$_i245) {
$key246 = '';
$val247 = new Type();
$xfer += $input->readString($key246);
$val247 = new Type();
$xfer += $val247->read($input);
$this->success[$key246] = $val247;
}
$xfer += $input->readMapEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
case 1:
if ($ftype == TType::STRUCT) {
$this->o2 = new MetaException();
$xfer += $this->o2->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
示例2: Type
<div class="col-sm-10">
<input type="text" name='nom' class="form-control" id="nomBouteille" value='<?php
echo $bouteille->nom;
?>
' >
</div>
</div>
<div class="form-group">
<label for="id_type" class="col-sm-2 control-label">Type</label>
<div class="col-sm-10">
<?php
// read the bouteille categories from the database
include_once 'objects/Type.php';
$type = new Type($db);
$stmt = $type->read();
// put them in a select drop-down
echo "<select class='form-control' name='id_type'>";
echo "<option>Choisir le type ...</option>";
while ($row_cepage = $stmt->fetch(PDO::FETCH_ASSOC)) {
extract($row_cepage);
// current cepage of the product must be selected
if ($bouteille->id_type == $id) {
echo "<option value='{$id}' selected>";
} else {
echo "<option value='{$id}'>";
}
echo "{$libelle}</option>";
}
echo "</select>";
?>