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


PHP Entry::clauseSafe方法代码示例

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


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

示例1: performHandlerTasks

 public function performHandlerTasks()
 {
     if (($author_id = Application::param('author_id')) && ($entry_id = Application::param('entry_id'))) {
         $entry = new Entry();
         $entry->clauseSafe('author_id', $author_id);
         $entry->clauseSafe('entry_id', $entry_id);
         $this->entry_to_manage_for = $entry;
     } else {
         $this->redirectOnAccessDenied();
     }
     if (!LogbookAccess::currentUserCanManageAccess($this->entryToManageFor())) {
         $this->redirectOnAccessDenied();
     }
     if ($group_id = Application::param('group_id')) {
         $this->group_to_manage_for = new Group();
         $this->group_to_manage_for->clauseSafe('group_id', $group_id);
     }
     if (Application::formPosted()) {
         if (Application::param('choose_group')) {
             $this->chooseGroup();
         }
         if (Application::param('manage_access')) {
             $this->manageAccess();
         }
     }
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:26,代码来源:manage_group_access.class.php

示例2: blogEntry

        public static function blogEntry($author_id = '',$entry_id = '')
	{
	    $entry = new Entry();
        $min_access = Application::user()->minAccessLevel();
        $access = $entry->also('Access');
        $access->clause('access_level',$min_access,Clause::GTE);
	    
	    if(Application::user()->id())
	    {
	        $lbk_user = $entry->also('LogbookUser');
                $lbk_user->clauseSafe('user_id',Application::user()->id());
	    }

	    if($author_id)
	        $entry->clauseSafe('author_id',Logbook::current()->authorId());

	        $entry->maybe('BlogTag');
            
            if(!$entry_id)
                $entry_id = Application::param('entry_id');

            if($entry_id&&$author_id)
	        $entry->clauseSafe('entry_id',$entry_id);

            $entry->order('entry_date');
            
            /*$entry->order('author_id');
            $entry->order('entry_id');*/
            $entry->maybe('Comment');
            $entry->descending();
            
            try
            {
	        $page = $entry->page(1,1);
	        $ret = current($page->objects());
	        Logbook::current()->setAuthorId($ret->get('author_id'));
            }
            
            catch(Exception $exc)
            {
                $ret = new Entry();
            }
	    
	    return $ret;
        }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:45,代码来源:view_blog_entry.class.php

示例3: entryToEdit

    protected function entryToEdit()
	{
	    if(!is_object($this->entry_to_edit))
	    {
    	        $fetch = new Entry();
    	        $fetch->maybe('BlogTag');
    	        $fetch->noForeign();
    	        $fetch->clauseSafe('author_id',Logbook::current()->authorId());
    	    
    	        if($id = Application::param('entry_id'))
    	            $fetch->clauseSafe('entry_id',Application::param('entry_id'));
    	        else
    	            throw new AccessDeniedException('Tried to edit an empty entry id');
    	        
    	        $this->entry_to_edit = $fetch;
	    }
            
	    return $this->entry_to_edit;
        }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:19,代码来源:edit_blog_entry.class.php


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