/** * @param integer $id * @return WebsiteSetting */ public static function getById($id) { $setting = new self(); $setting->setId(intval($id)); $setting->getDao()->getById(); return $setting; }
/** * @param integer $id * @return Redirect */ public static function getById($id) { $redirect = new self(); $redirect->setId(intval($id)); $redirect->getDao()->getById(); return $redirect; }
/** * 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; }
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; }
/** * @param integer $id * @return Glossary */ public static function getById($id) { $glossary = new self(); $glossary->setId(intval($id)); $glossary->getResource()->getById(); return $glossary; }
/** * @param integer $id * @return self */ public static function getById($id) { $metadata = new self(); $metadata->setId($id); $metadata->getDao()->getById(); return $metadata; }
/** * @param integer $id * @return self */ public static function getById($id) { $property = new self(); $property->setId($id); $property->getDao()->getById(); return $property; }
/** * @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; }
public static function inicializar($params) { $necesidad = new self(); $necesidad->setId($params['id']); $necesidad->setDescripcion($params['descripcion']); $necesidad->setBaja($params['baja']); return $necesidad; }
/** * 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; }
public static function inicializar($params) { $servicio = new self(); $servicio->setId($params['id']); $servicio->setDescripcion($params['descripcion']); $servicio->setBaja($params['baja']); return $servicio; }
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; }
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; }
/** * 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(); }
/** * @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; }
/** * Criar Item com campos obrigatórios preenchidos * * @param string $id - Código do Produto * @param string $name - Nome do Produto * @param float $value - Valor Unitário * @param integer $quantity - Quantidade * * @return Item */ public static function create($id, $name, $value, $quantity) { $instance = new self(); $instance->setId($id); $instance->setName($name); $instance->setValue($value); $instance->setQuantity($quantity); return $instance; }
public static function inicializar($params) { $estadoPedido = new self(); $estadoPedido->setId($params['id']); $estadoPedido->setDescripcion($params['descripcion']); $estadoPedido->setEntregado($params['entregado']); $estadoPedido->setBaja($params['baja']); return $estadoPedido; }
public static function inicializar($params) { $turnoEntrega = new self(); $turnoEntrega->setId($params['id']); $turnoEntrega->setFecha($params['fecha']); $turnoEntrega->setHora($params['hora']); $turnoEntrega->setBaja($params['baja']); return $turnoEntrega; }
public static function inicializar($params) { $entregaDirecta = new self(); $entregaDirecta->setId($params['id']); $entregaDirecta->setEntidad_receptora_id($params['entidad_receptora_id']); $entregaDirecta->setFecha($params['fecha']); $entregaDirecta->setBaja($params['baja']); return $entregaDirecta; }
/** * @param array $params * @return Supporter */ public static function create(array $params = []) : SupporterInterface { if (empty($params)) { return new NullSupporter(); } $class = new self($params['name'] ?? null, $params['url'] ?? null, new Twitter($params['twitter'] ?? null) ?? null, new Email($params['email'] ?? null) ?? null, $params['logo'] ?? null); $class->setId($params['id'] ?? null); return $class; }
public static function createFromArray(array $row) { $order = new self(); if (array_key_exists('id', $row)) { $order->setId($row['id']); } $order->setStatus($row['status']); return $order; }
/** * @param \stdClass $data * * @return Organization */ public static function createFromStdClass(\stdClass $data) { $organization = new self(); $organization->setId($data->id)->setName($data->name); foreach ($data->shops as $shopData) { $organization->addShop(Shop::createFromStdClass($shopData)); } return $organization; }
public static function inicializar($params) { $usuario = new self(); $usuario->setId($params['id']); $usuario->setUsername($params['username']); $usuario->setClave($params['clave']); $usuario->setRol($params['rol']); return $usuario; }
/** * @param \stdClass $data * * @return UserPromotion */ public static function createFromStdClass(\stdClass $data) { $userPromotion = new self(); $userPromotion->setId($data->id)->setPromotion(Promotion::createFromStdClass($data->promotion))->setRealValue($data->real_value)->setAuthData($data->auth_data); if ($data->expires_at !== null) { $userPromotion->setExpiresAt((new \DateTime(null, new \DateTimeZone('UTC')))->setTimestamp($data->expires_at)); } return $userPromotion; }
public static function inicializar($params) { $alimento = new self(); $alimento->setId($params['id']); $codigo = str_replace(" ", "_", $params['codigo']); $alimento->setCodigo($codigo); $alimento->setBaja($params['baja']); $alimento->setDescripcion($params['descripcion']); return $alimento; }
public static function inicializar($params) { $alimento = new self(); $alimento->setId($params['id']); $alimento->setDetalle_id($params['detalle_id']); $alimento->setDonante_id($params['donante_id']); $alimento->setCantidad($params['cantidad']); $alimento->setBaja($params['baja']); return $alimento; }
public static function createFromArray(array $data) { $movement = new self(); $movement->setId(isset($data['id']) ? $data['id'] : null); $movement->setDate(new \DateTime($data['date'])); $movement->setAmount(new \InFog\SimpleFinance\Types\Money($data['amount'])); $movement->setName(new \InFog\SimpleFinance\Types\SmallString($data['name'])); $movement->setDescription(new \InFog\SimpleFinance\Types\Text($data['description'])); return $movement; }
/** * @param integer $id * @return Model\Object\KeyValue\GroupConfig */ public static function getById($id) { try { $config = new self(); $config->setId(intval($id)); $config->getResource()->getById(); return $config; } catch (\Exception $e) { } }
public static function __set_state($array) { $businessEntity = new self(); $businessEntity->setId($array['id']); $businessEntity->setClass($array['class']); $businessEntity->setName($array['name']); $businessEntity->setBusinessProperties($array['businessProperties']); $businessEntity->setDisable($array['disable']); return $businessEntity; }
public static function factory(array $data) { $rpc = new self(); $rpc->setId($data['tid']); $rpc->setAction($data['action']); $rpc->setMethod($data['method']); $rpc->setData($data['data'] ?: array()); $rpc->setParameters($data); return $rpc; }