本文整理匯總了PHP中type::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::getId方法的具體用法?PHP type::getId怎麽用?PHP type::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::getId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor
* @param type $a_parent_obj
* @param type $a_parent_cmd
* @param type $a_template_context
*/
public function __construct($a_parent_obj_gui, $a_parent_obj, $a_parent_cmd)
{
$this->parent_container = $a_parent_obj;
$this->setId('lomemtstres_' . $a_parent_obj->getId());
parent::__construct($a_parent_obj_gui, $a_parent_cmd);
$this->settings = ilLOSettings::getInstanceByObjId($a_parent_obj->getId());
}
示例2: cancelOrderUrl
/**
*
* @param type $order
* @return string
*/
public function cancelOrderUrl($order, $recurring = false)
{
$url = Mage::getUrl('recurring/orders/delete');
if ($recurring) {
$url .= '?options[' . self::OPTIONSID . '][recurring_id]=' . $order->getId();
} else {
$url .= '?options[' . self::OPTIONSID . '][order_id]=' . $order->getId();
}
$url .= '&options[' . self::OPTIONSID . '][deleteorder]=1';
$url .= '" onClick="return confirm(\'Are you sure that you want to delete this order?\');';
return $url;
}
示例3: transform
/**
* Convert to form value.
*
* @param type $value
*/
public function transform($value)
{
if ($value === null) {
return;
}
return $value->getId();
}
示例4: getBoilerplateLinkedText
/**
* if webcomm boilerplate is used, we can use bootstrap modals
* @param type $agreement
* @return type
*/
public function getBoilerplateLinkedText($agreement)
{
$text = Mage::helper('core')->escapeHtml($agreement->getCheckboxText(), null);
foreach ($this->getKeywords() as $word) {
$text = str_replace($word, '<a href="#" data-toggle="modal" data-target="#agreement-content-' . $agreement->getId() . '" >' . $word . '</a>', $text);
}
return $text;
}
示例5: saveTeacher
/**
* saving after teacher_signup
*
* @param type $object
* @return boolean
*/
public function saveTeacher($object)
{
if ($object->getId() == null) {
$object->setCreated(new \DateTime('now'));
$object->setActive(true);
$object->setCategory('t');
}
$this->getEntityManager()->merge($object);
$this->getEntityManager()->flush();
return true;
}
示例6: getSubUnitsChain
/**
* Get Sub units chain
* @param type $node parent subunit
* @return string Chain of subunits ids, separated by commas
*/
public function getSubUnitsChain($node)
{
$value = $node->getId();
$children = $node->getNode()->getChildren();
if ($children !== false) {
foreach ($children as $childNode) {
$value = $value . "," . $this->getSubUnitsChain($childNode);
}
}
return $value;
}
示例7: postOrderTraversal
/**
* @param type $tree tree
* @param type $begin begin
* @param type &$end end
* @param type $em em
*/
public function postOrderTraversal($tree, $begin, &$end, $em)
{
//get $tree childrens
$children = $em->getRepository('CMSAdminBUndle:Menu')->getChildren($tree->getId());
$tree->setLft($begin);
$end = ++$begin;
//Travesal the tree
foreach ($children as $child) {
$repositor = $em->getRepository('CMSAdminBUndle:Menu');
$repositor->postOrderTraversal($child, $begin, $end, $em);
$begin = ++$end;
}
$tree->setRgt($end);
}
示例8: updateBasket
/**
* Update an item
* @param type $basketObj
* @return type
*/
public static function updateBasket($basketObj)
{
$userId = \Core\Db::escape($basketObj->getUserId());
$petId = \Core\Db::escape($basketObj->getPetId());
$id = $basketObj->getId();
$sql = <<<q
UPDATE `basket` SET
`user_id` = '{$userId}',
`pet_id` = '{$petId}'
WHERE `id` = {$id};
q;
//echo "<br/><br/>" . $sql . "<br/><br/>";
$res = \Core\Db::execute($sql);
return $res === false ? false : true;
}
示例9: getMostRecentBirthdayTransfer
/**
* Get most recent birthday transfer linked to a provided customer
* Returns null if no fransfer is found
*
* @param type $customer
* @return type
*/
public function getMostRecentBirthdayTransfer($customer)
{
// latest birthday transfer
$birthdayTransfers = $this->getTransfersAssociatedWithBirthday()->addFilter('customer_id', $customer->getId())->load();
$latest_transfer = null;
foreach ($birthdayTransfers as $transfer) {
if (null == $latest_transfer) {
$latest_transfer = $transfer;
}
if (strtotime($transfer->getCreationTs()) >= strtotime($latest_transfer->getCreationTs())) {
$latest_transfer = $transfer;
}
}
return $latest_transfer;
}
示例10: checkEvents
/**
* Функция выбирает варианты событий для заданной комнаты, по которым не было оповещений за $minDelay
* проверяет выходы параметров за пределы, отправляет уведомления,
* @param type $s
* @param type $room
* @return type
*/
public function checkEvents($s, $room)
{
$em = $this->getEntityManager();
$n = new \DateTime("now", new \DateTimeZone("Europe/Moscow"));
$this->ev_time = $n->sub(new \DateInterval($this->minDelay));
$qb = $em->createQueryBuilder();
$qb->select('e', 'max(h.evTime)')->from('AppBundle:Events', 'e')->leftJoin('AppBundle:Histories', 'h', \Doctrine\ORM\Query\Expr\Join::WITH, 'h.ev=e.id')->join('e.room', 'r')->join("e.userid", "u")->where("e.room = :room")->groupBy('e.id')->setParameter('room', $room->getId());
$query = $qb->getQuery();
$ev = $query->getResult();
$stat = $s[0];
foreach ($ev as $e) {
$last = isset($e[1]) ? new \DateTime($e[1], new \DateTimeZone("Europe/Moscow")) : new \DateTime("2012-07-08");
$this->checkT($e, $stat, $last);
$this->checkH($e, $stat, $last);
$this->checkCO2($e, $stat, $last);
$this->checkVOC($e, $stat, $last);
}
return $this->sendEvents();
}
示例11: _addColumnFilterToCollection
/**
* Adds column to filter list if needed
* @param type $column Column to filter
* @return TinyBrick_OrderEdit_Block_Adminhtml_Sales_Order_Edit_Search_Grid
*/
protected function _addColumnFilterToCollection($column)
{
// Set custom filter for in product flag
if ($column->getId() == 'in_products') {
$productIds = $this->_getSelectedProducts();
if (empty($productIds)) {
$productIds = 0;
}
if ($column->getFilter()->getValue()) {
$this->getCollection()->addFieldToFilter('entity_id', array('in' => $productIds));
} else {
if ($productIds) {
$this->getCollection()->addFieldToFilter('entity_id', array('nin' => $productIds));
}
}
} else {
parent::_addColumnFilterToCollection($column);
}
return $this;
}
示例12: updateUser
/**
* Update the data of an existing user
* @param type $userObj an instance of the User class
* @return type boolean false if update fails, true otherwise
*/
public static function updateUser($userObj)
{
$id = $userObj->getId();
$username = \Core\Db::escape($userObj->getUsername());
$password = \Core\Db::escape($userObj->getPassword());
$email = \Core\Db::escape($userObj->getEmail());
$created = $userObj->getCreated();
$updated = time();
$isAdmin = $userObj->getIsAdmin();
$lastLogin = \Core\Db::escape($userObj->getLastLogin());
$sql = <<<q
UPDATE `user` SET
`username` = '{$username}',
`password` = '{$password}',
`email` = '{$email}',
`created` = {$created},
`updated` = {$updated},
`is_admin` = {$isAdmin},
`last_login` = '{$lastLogin}'
WHERE `id` = {$id};
q;
$res = \Core\Db::execute($sql);
return $res === false ? false : true;
}
示例13: getRightSideBlocks
/**
* returns right side blocks filtered by pageType / object
*
* @param type $pageType
* @param type $object
* @param type $path
* @return type
*/
public function getRightSideBlocks($pageType, $object)
{
if ($object == null || $pageType == null) {
return null;
}
$containerFilters = array('pageType' => $pageType, 'active' => true);
$containerFilters['id'] = $object->getId();
$containerFilters['categories'] = array();
if ($object->getCategory() != null) {
$containerFilters['categories'][] = $object->getCategory()->getId();
}
if ($object->getSubcategory() != null) {
$containerFilters['categories'][] = $object->getSubcategory()->getId();
}
$containers = $this->getPageBlockContainers($containerFilters);
$blocks = $this->getPageBlocksFromContainers($containers);
//foreach ($containers as $c) {
// var_dump($c->getId());
//}die;
// foreach ($blocks as $c) {
// var_dump($c);
// }die;
return $blocks;
}
示例14: evaluateWorkerBeginMiss
/**
*
* @param type $trabajador
* @return boolean
*/
public function evaluateWorkerBeginMiss($trabajador)
{
$nextWD = $this->nextWorkingDay($trabajador->getId());
if (!$nextWD) {
//En caso de que el trabajador no contenga ningun registro anterior
return false;
}
$horario = $trabajador->getHorario();
$nextWD->setTimezone(new \DateTimeZone($horario->getTimeZone()));
$actual = new \DateTime('now');
$actual->setTimezone(new \DateTimeZone($horario->getTimeZone()));
if ($this->horarioManager->equalDates($nextWD, $actual)) {
$eval = $this->horarioManager->evaluateTime($horario->getId(), $actual);
if (!$eval) {
$this->registroManager->beginWork($trabajador->getId(), $actual, 'not_mark', false);
}
}
}
示例15: deleteTopicPhoto
/**
* Удалить изображение
* @param type $oPhoto
* @return type
*/
public function deleteTopicPhoto($oPhoto)
{
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array("photoset_photo_update"));
$this->oMapperTopic->deleteTopicPhoto($oPhoto->getId());
@unlink($this->Image_GetServerPath($oPhoto->getWebPath()));
$aSizes = Config::Get('module.topic.photoset.size');
// Удаляем все сгенерированные миниатюры основываясь на данных из конфига.
foreach ($aSizes as $aSize) {
$sSize = $aSize['w'];
if ($aSize['crop']) {
$sSize .= 'crop';
}
@unlink($this->Image_GetServerPath($oPhoto->getWebPath($sSize)));
}
return;
}