當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。