本文整理汇总了PHP中Component::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::getId方法的具体用法?PHP Component::getId怎么用?PHP Component::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Component
的用法示例。
在下文中一共展示了Component::getId方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addComponent
protected final function addComponent(Component &$component)
{
if ($this->childExists($component->getId())) {
throw new \RuntimeException(sprintf("Component %s already has a child with id %s", $this->getId(), $component->getId()));
}
if ($component->added) {
throw new \RuntimeException(sprintf("Component %s has already been added to another", $component->getId()));
}
if ($component == $this) {
throw new \RuntimeException(sprintf("Component %s cannot be added to itself.", $component->getId()));
}
$this->children[$component->getId()] = $component;
$this->onComponentAdded($component);
}
示例2: onInherit
public function onInherit(Component &$component)
{
if (!PropertyResolver::hasProperty($this->getModelObject(), $component->getId())) {
return null;
}
return new WrappedCompoundModel($this);
}
示例3: getExistsCourse
/**
* Returns whether the component is installed for the given course
*
* Called when this component receives an HTTP GET request to
* /link/exists/course/$courseid(/).
*
* @param int $courseid A course id.
*/
public function getExistsCourse($courseid)
{
$result = Request::routeRequest('GET', '/process/course/' . $courseid . '/component/' . $this->_conf->getId(), $this->app->request->headers->all(), '', $this->_getProcess, 'process');
if (isset($result['status']) && $result['status'] >= 200 && $result['status'] <= 299 && isset($result['content']) && $this->_conf !== null && $this->_conf->getId() !== null) {
$this->app->response->setStatus(200);
$this->app->stop();
}
$this->app->response->setStatus(409);
}
示例4: renderHead
public function renderHead(Component $component, HeaderContainer $headerContainer, HeaderResponse $headerResponse)
{
$markup = $component->loadAssociatedMarkup();
$heads = $this->findHead(array($markup));
foreach ($heads as $index => $head) {
$id = $component->getId() . '_head_' . $index;
$headerPart = new HeaderPartContainer($id, $head);
$headerPart->render();
}
}
示例5: getMarkup
public function getMarkup(MarkupContainer $container, Component $child)
{
$markup = $container->getMarkup();
if ($markup == null) {
throw new \MarkupNotFoundException(sprintf("Markup for %s could not be found.", $child->getId()));
}
if ($child == null) {
return $markup;
}
$m = MarkupUtils::findComponentTag($markup, $child->getId(), $container);
if ($m == null) {
foreach ($container->getChildren() as $ch) {
if ($ch != $child && $ch instanceof MarkupContainer && $ch instanceof ComponentResolver) {
$m = $ch->getMarkupForChild($child);
if ($m != null) {
return $m;
}
}
}
}
return $m;
}
示例6: handle
/**
* @param \PowerEcommerce\Framework\Routing\Component $target
*
* @return \PowerEcommerce\System\Object
*/
public function handle(Component $target)
{
/** @type \PowerEcommerce\Framework\Routing\Target $target */
!$target instanceof \PowerEcommerce\Framework\Routing\Target && $this->invalid();
/** @type \PowerEcommerce\Framework\Routing\Component $route */
foreach ($this->getComponents() as $route) {
$pattern = '/' . addcslashes($route->getId(), '/') . '/' . $route->getModifiers();
if (preg_match($pattern, $target->getId()) || $route instanceof \PowerEcommerce\Framework\Routing\Router) {
$route->handle($target);
}
}
return $this;
}
示例7: getExistsCourse
/**
* Returns whether the component is installed for the given course
*
* Called when this component receives an HTTP GET request to
* /link/exists/course/$courseid(/).
*
* @param int $courseid A course id.
*/
public function getExistsCourse($courseid)
{
// hier soll geprüft werden, ob ein entsprechender Eintrag für diese Komponente in der referenzierten Prozesstabelle besteht,
// ob sie also als Verarbeitung registriert ist (dazu wird die ID dieser Komponente verwendet ($this->_conf->getId()))
$result = Request::routeRequest('GET', '/process/course/' . $courseid . '/component/' . $this->_conf->getId(), array(), '', $this->_getProcess, 'process');
// wenn etwas für die ID dieser Komponente von der DB geantwortet wird, ist die Installation korrekt bzw. vorhanden.
if (isset($result['status']) && $result['status'] >= 200 && $result['status'] <= 299 && isset($result['content']) && $this->_conf !== null && $this->_conf->getId() !== null) {
$this->app->response->setStatus(200);
$this->app->stop();
}
// die Datenbank hat keinen Eintrag für diese Komponente geliefert oder ein sonstiger Fehler ist aufgetreten, daher
// gilt die Installation als nicht vorhanden/korrekt
$this->app->response->setStatus(409);
}
示例8: internalFindComponentTag
private static function internalFindComponentTag(XmlElement $markup, $componentTagId, Component $component)
{
if ($markup instanceof ComponentTag && $markup->getComponentTagId() == $componentTagId) {
return $markup;
} else {
if ($markup instanceof MarkupElement && $markup->hasChildren() && (!$markup instanceof ComponentTag || $component->getId() == $markup->getComponentTagId())) {
$componentTag = null;
foreach ($markup->getChildren() as $element) {
if ($element instanceof MarkupElement) {
$componentTag = self::internalFindComponentTag($element, $componentTagId, $component);
if ($componentTag != null) {
return $componentTag;
}
}
}
}
return null;
}
}
示例9: detach
/**
* @param \PowerEcommerce\Framework\Security\Component $component
*
* @return $this
*/
public function detach(Component $component)
{
!$component instanceof \PowerEcommerce\Framework\Security\Privilege && $this->invalid();
return $this->del($component->getId());
}
示例10: invalidate
/**
* Add the component for invalidation
*
* @param Component $c
*
* @return void
*/
public function invalidate(Component $c)
{
$this->components[$c->getId()] = $c;
}
示例11: flush
/**
*
* @param Component $component
* @return int id of the Component inserted in base. False if it didn't work.
*/
public static function flush($component)
{
$componentId = $component->getId();
$mark = $component->getMark();
$date = $component->getDate();
$isResit = $component->getIsResit();
$user = $component->getUser()->getId();
$componentLinked = $component->getComponent()->getId();
$module = $component->getModule()->getId();
$type = $component->getType()->getId();
if ($componentId > 0) {
$sql = 'UPDATE component c SET ' . 'c.mark = ?, ' . 'c.date = ?, ' . 'c.is_resit = ?, ' . 'c.USER_id_user = ?, ' . 'c.COMPONENT_id_component = ?, ' . 'c.MODULE_id_module = ?, ' . 'c.TYPE_id_type= ? ' . 'WHERE c.id_component = ?';
$params = array('dsiiiiii', &$mark, &$date, &$isResit, &$user, &$componentLinked, &$module, &$type, &$componentId);
} else {
$sql = 'INSERT INTO component ' . '(mark, date, is_resit, ' . 'USER_id_user, COMPONENT_id_component, MODULE_id_module, TYPE_id_type ) ' . 'VALUES(?, ?, ?, ?, ?, ?, ?) ';
$params = array('dsiiiii', &$mark, &$date, &$isResit, &$user, &$componentLinked, &$module, &$type);
}
$idInsert = BaseSingleton::insertOrEdit($sql, $params);
if ($idInsert !== false && $componentId > 0) {
$idInsert = $componentId;
}
return $idInsert;
}
示例12: onNotAuthorised
public function onNotAuthorised(Component $component)
{
throw new UnAuthorisdeException(sprintf('Not authorised for component %s', $component->getId()));
}