当前位置: 首页>>代码示例>>PHP>>正文


PHP Link::getId方法代码示例

本文整理汇总了PHP中Link::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::getId方法的具体用法?PHP Link::getId怎么用?PHP Link::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Link的用法示例。


在下文中一共展示了Link::getId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete(Link $dto)
 {
     BOL_CommentService::getInstance()->deleteEntityComments('link', $dto->getId());
     BOL_TagService::getInstance()->deleteEntityTags($dto->getId(), 'link');
     BOL_VoteService::getInstance()->deleteEntityItemVotes($dto->getId(), 'link');
     BOL_FlagService::getInstance()->deleteByTypeAndEntityId('link', $dto->getId());
     OW::getCacheManager()->clean(array(LinkDao::CACHE_TAG_LINK_COUNT));
     OW::getEventManager()->trigger(new OW_Event('feed.delete_item', array('entityType' => 'link', 'entityId' => $dto->getId())));
     $this->dao->delete($dto);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:link_service.php

示例2: prune

 /**
  * Exclude object from result
  *
  * @param   Link $link Object to remove from the list of results
  *
  * @return LinkQuery The current query, for fluid interface
  */
 public function prune($link = null)
 {
     if ($link) {
         $this->addUsingAlias(LinkPeer::ID, $link->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
开发者ID:rapila,项目名称:cms-base,代码行数:14,代码来源:BaseLinkQuery.php

示例3: importer


//.........这里部分代码省略.........
            $post->id = $node['id'][0]['.value'];
            $post->slogan = @$node['.attributes']['slogan'];
            $post->visibility = $node['visibility'][0]['.value'];
            if (isset($node['starred'][0]['.value'])) {
                $post->starred = $node['starred'][0]['.value'];
            } else {
                $post->starred = 0;
            }
            $post->title = $node['title'][0]['.value'];
            $post->content = $node['content'][0]['.value'];
            $post->contentformatter = isset($node['content'][0]['.attributes']['formatter']) ? $node['content'][0]['.attributes']['formatter'] : 'ttml';
            $post->contenteditor = isset($node['content'][0]['.attributes']['editor']) ? $node['content'][0]['.attributes']['editor'] : 'modern';
            $post->location = $node['location'][0]['.value'];
            $post->password = isset($node['password'][0]['.value']) ? $node['password'][0]['.value'] : null;
            $post->acceptcomment = $node['acceptComment'][0]['.value'];
            $post->accepttrackback = $node['acceptTrackback'][0]['.value'];
            $post->published = $node['published'][0]['.value'];
            if (isset($node['longitude'][0]['.value'])) {
                $post->longitude = $node['longitude'][0]['.value'];
            }
            if (isset($node['latitude'][0]['.value'])) {
                $post->latitude = $node['latitude'][0]['.value'];
            }
            $post->created = @$node['created'][0]['.value'];
            $post->modified = @$node['modified'][0]['.value'];
            if ($post->visibility == 'private' && intval($post->published) > $_SERVER['REQUEST_TIME'] || !empty($node['appointed'][0]['.value']) && $node['appointed'][0]['.value'] == 'true') {
                // for compatibility of appointed entries
                $post->visibility = 'appointed';
            }
            if ($post->slogan == '') {
                $post->slogan = 'Untitled' . $post->id;
            }
            if (!empty($node['category'][0]['.value'])) {
                $post->category = Category::getId($node['category'][0]['.value']);
            }
            if (isset($node['tag'])) {
                $post->tags = array();
                for ($i = 0; $i < count($node['tag']); $i++) {
                    if (!empty($node['tag'][$i]['.value'])) {
                        array_push($post->tags, $node['tag'][$i]['.value']);
                    }
                }
            }
            if (floatval(Setting::getServiceSettingGlobal('newlineStyle')) >= 1.1 && floatval(@$node['.attributes']['format']) < 1.1) {
                $post->content = nl2brWithHTML($post->content);
            }
            if (!$post->add()) {
                user_error(__LINE__ . $post->error);
            }
            if (isset($node['attachment'])) {
                for ($i = 0; $i < count($node['attachment']); $i++) {
                    $attachment = new Attachment();
                    $attachment->parent = $post->id;
                    $cursor =& $node['attachment'][$i];
                    $attachment->name = $cursor['name'][0]['.value'];
                    $attachment->label = $cursor['label'][0]['.value'];
                    $attachment->mime = @$cursor['.attributes']['mime'];
                    $attachment->size = $cursor['.attributes']['size'];
                    $attachment->width = $cursor['.attributes']['width'];
                    $attachment->height = $cursor['.attributes']['height'];
                    $attachment->enclosure = @$cursor['enclosure'][0]['.value'];
                    $attachment->attached = $cursor['attached'][0]['.value'];
                    $attachment->downloads = @$cursor['downloads'][0]['.value'];
                    if (!$attachment->add()) {
                        user_error(__LINE__ . $attachment->error);
                    } else {
开发者ID:webhacking,项目名称:Textcube,代码行数:67,代码来源:index.php

示例4: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param Link $obj A Link object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         LinkPeer::$instances[$key] = $obj;
     }
 }
开发者ID:rapila,项目名称:cms-base,代码行数:22,代码来源:BaseLinkPeer.php

示例5: addLink

 /**
  * @param Link $link
  */
 public function addLink(Link $link)
 {
     $link->assertValid();
     $this->links[$link->getId()] = $link;
 }
开发者ID:thomblin,项目名称:bookmarks,代码行数:8,代码来源:Group.php

示例6: process

 public function process()
 {
     OW::getCacheManager()->clean(array(LinkDao::CACHE_TAG_LINK_COUNT));
     $service = LinkService::getInstance();
     $data = $this->getValues();
     $data['title'] = UTIL_HtmlTag::stripJs($data['title']);
     $url = mb_ereg_match('^http(s)?:\\/\\/', $data['url']) ? $data['url'] : 'http://' . $data['url'];
     $this->link->setTimestamp(time())->setUrl($url)->setDescription($data['description'])->setTitle(UTIL_HtmlTag::stripTags($data['title'], $service->getAllowedHtmlTags(), array('*')));
     $tags = array();
     $isNew = empty($this->link->id);
     $service->save($this->link);
     if (intval($this->link->getId()) > 0) {
         $tags = $data['tags'];
     }
     $tagService = BOL_TagService::getInstance();
     $tagService->updateEntityTags($this->link->getId(), 'link', $tags);
     if (!$isNew) {
         $event = new OW_Event(LinkService::EVENT_EDIT, array('id' => $this->link->getId()));
         OW::getEventManager()->trigger($event);
         return;
     }
     $eventParams = array('pluginKey' => 'links', 'action' => 'add_link');
     if (OW::getEventManager()->call('usercredits.check_balance', $eventParams) === true) {
         OW::getEventManager()->call('usercredits.track_action', $eventParams);
     }
     //Newsfeed
     $event = new OW_Event('feed.action', array('pluginKey' => 'links', 'entityType' => 'link', 'entityId' => $this->link->getId(), 'userId' => $this->link->getUserId()));
     OW::getEventManager()->trigger($event);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:29,代码来源:save.php

示例7: removeLink

 public function removeLink(Link $link)
 {
     $count = count($this->links);
     $id = $link->getId();
     for ($i = 0; $i < $count; $i++) {
         if ($this->links[$i]->getId() === $id) {
             array_splice($this->links, $i, 1);
             $i--;
             $count--;
         }
     }
     return $this;
 }
开发者ID:jatolmed,项目名称:links,代码行数:13,代码来源:Section.php


注:本文中的Link::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。