本文整理汇总了PHP中self::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP self::setId方法的具体用法?PHP self::setId怎么用?PHP self::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类self
的用法示例。
在下文中一共展示了self::setId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getById
/**
* @param integer $id
* @return WebsiteSetting
*/
public static function getById($id)
{
$setting = new self();
$setting->setId(intval($id));
$setting->getDao()->getById();
return $setting;
}
示例2: getById
/**
* @param integer $id
* @return Redirect
*/
public static function getById($id)
{
$redirect = new self();
$redirect->setId(intval($id));
$redirect->getDao()->getById();
return $redirect;
}
示例3: getById
/**
* Static helper to retrieve an instance of Document_DocType by the given ID
*
* @param integer $id
* @return Document_DocType
*/
public static function getById($id)
{
$docType = new self();
$docType->setId(intval($id));
$docType->getResource()->getById();
return $docType;
}
示例4: getFromId
public static function getFromId($id)
{
$db = Neuron_DB_Database::getInstance();
$id = intval($id);
$d = $db->query("\n\t\t\tSELECT\n\t\t\t\t*,\n\t\t\t\tUNIX_TIMESTAMP(er_date) AS datum\n\t\t\tFROM\n\t\t\t\teffect_report\n\t\t\tWHERE\n\t\t\t\ter_id = {$id}\n\t\t");
if (count($d) > 0) {
$village = Dolumar_Registry_Village::getInstance()->get($d[0]['er_vid']);
$classname = 'Dolumar_Report_' . $d[0]['er_type'];
if (class_exists($classname)) {
$report = new $classname($village);
} else {
$report = new self($village);
}
$report->setId($id);
foreach (self::getObjectsFromLog($d[0]['er_data']) as $v) {
$report->addItem($v);
}
$report->setDate($d[0]['datum']);
if (isset($d[0]['er_target_v_id'])) {
$report->setTarget(Dolumar_Registry_Village::getInstance()->get($d[0]['er_target_v_id']));
}
return $report;
}
return false;
}
示例5: getById
/**
* @param integer $id
* @return Glossary
*/
public static function getById($id)
{
$glossary = new self();
$glossary->setId(intval($id));
$glossary->getResource()->getById();
return $glossary;
}
示例6: getById
/**
* @param integer $id
* @return self
*/
public static function getById($id)
{
$metadata = new self();
$metadata->setId($id);
$metadata->getDao()->getById();
return $metadata;
}
示例7: getById
/**
* @param integer $id
* @return self
*/
public static function getById($id)
{
$property = new self();
$property->setId($id);
$property->getDao()->getById();
return $property;
}
示例8: createFromProduct
/**
* @param SyliusProduct $product
* @param array $options
*
* @return Product
*/
public static function createFromProduct(SyliusProduct $product, array $options = null)
{
$options = array_merge(['list' => null, 'position' => null, 'quantity' => null, 'variant' => null], (array) $options);
$price = $product->getPrice() / 100;
$instance = new self();
$instance->setId($product->getId())->setName($product->getName())->setPrice($price)->setQuantity($options['quantity'])->setList($options['list'])->setPosition($options['position'])->setVariant($options['variant']);
return $instance;
}
示例9: inicializar
public static function inicializar($params)
{
$necesidad = new self();
$necesidad->setId($params['id']);
$necesidad->setDescripcion($params['descripcion']);
$necesidad->setBaja($params['baja']);
return $necesidad;
}
示例10: factory
/**
* Factory
*/
public function factory($values)
{
// Get the pages from the database
$pages = Page::findAllByChapter($values['id']);
$chapter = new self($values['number'], $values['name'], $pages);
$chapter->setId($values['id']);
return $chapter;
}
示例11: inicializar
public static function inicializar($params)
{
$servicio = new self();
$servicio->setId($params['id']);
$servicio->setDescripcion($params['descripcion']);
$servicio->setBaja($params['baja']);
return $servicio;
}
示例12: initWithArray
public static function initWithArray($array)
{
$instance = new self(NULL, NULL, NULL);
$instance->setName($array[EventCategory::EVENTCATEGORY_NAME]);
$instance->setId($array[EventCategory::EVENTCATEGORY_ID]);
$instance->setPar_cat($array[EventCategory::EVENTCATEGORY_PAR_CAT]);
return $instance;
}
示例13: inicializar
public static function inicializar($params)
{
$configuracion = new self();
$configuracion->setId($params['id']);
$configuracion->setClave($params['clave']);
$configuracion->setValor($params['valor']);
$configuracion->setBaja($params['baja']);
return $configuracion;
}
示例14: mschapv2
/**
* Helper function for sending an MSCHAP v2 packet encapsulated in an EAP packet
*
* @param \Dapphp\Radius\MsChapV2Packet $chapPacket The MSCHAP v2 packet to send
* @param int $id The CHAP packet identifier (random if omitted)
* @return string An EAP-MSCHAPv2 packet
*/
public static function mschapv2(\Dapphp\Radius\MsChapV2Packet $chapPacket, $id = null)
{
$packet = new self();
$packet->setId($id);
$packet->code = self::CODE_RESPONSE;
$packet->type = self::TYPE_EAP_MS_AUTH;
$packet->data = $chapPacket->__toString();
return $packet->__toString();
}
示例15: create
/**
* @param array $params
* @return Speaker
*/
public static function create(array $params = []) : SpeakerInterface
{
if (empty($params)) {
return new NullSpeaker();
}
$class = new self($params['first_name'], $params['last_name'], new Email($params['email']), new Twitter($params['twitter']), $params['avatar']);
$class->setId($params['id']);
return $class;
}