idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
6,500 | protected function _GetFilter ( ) { $ Filter = $ this -> Request -> Get ( 'Filter' ) ; if ( $ Filter ) { $ Parts = explode ( ' ' , $ Filter , 3 ) ; if ( count ( $ Parts ) < 2 ) return FALSE ; $ Field = $ Parts [ 0 ] ; if ( count ( $ Parts ) == 2 ) { $ Op = '=' ; $ FilterValue = $ Parts [ 1 ] ; } else { $ Op = $ Parts [... | Get filter from current request . |
6,501 | private function HandleApplicant ( $ Action , $ UserID ) { $ this -> Permission ( 'Garden.Users.Approve' ) ; if ( ! in_array ( $ Action , array ( 'Approve' , 'Decline' ) ) || ! is_numeric ( $ UserID ) ) { $ this -> Form -> AddError ( 'ErrorInput' ) ; $ Result = FALSE ; } else { $ Session = Gdn :: Session ( ) ; $ UserMo... | Handle a user application . |
6,502 | protected function _OrderUrl ( $ Field ) { $ Get = Gdn :: Request ( ) -> Get ( ) ; $ Get [ 'order' ] = $ Field ; return '/dashboard/user?' . http_build_query ( $ Get ) ; } | Build URL to order users by value passed . |
6,503 | public function Summary ( $ SortField = 'DateLastActive' , $ SortDirection = 'desc' , $ Limit = 30 , $ Offset = 0 ) { $ this -> Title ( T ( 'User Summary' ) ) ; $ SortField = ! in_array ( $ SortField , array ( 'DateLastActive' , 'DateInserted' , 'Name' ) ) ? 'DateLastActive' : $ SortField ; $ SortDirection = $ SortDire... | Convenience function for listing users . At time of this writing it is being used by wordpress widgets to display recently active users . |
6,504 | public function UsernameAvailable ( $ Name = '' ) { $ this -> _DeliveryType = DELIVERY_TYPE_BOOL ; $ Available = TRUE ; if ( C ( 'Garden.Registration.NameUnique' , TRUE ) && $ Name != '' ) { $ UserModel = Gdn :: UserModel ( ) ; if ( $ UserModel -> GetByUsername ( $ Name ) ) $ Available = FALSE ; } if ( ! $ Available ) ... | Determine whether user can register with this username . |
6,505 | public function generatePermid ( ) { if ( $ this -> permid ) { return $ this ; } $ characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ; $ randomString = $ characters [ rand ( 10 , strlen ( $ characters ) - 1 ) ] ; for ( $ i = 1 ; $ i < 24 ; $ i ++ ) { $ randomString .= $ characters [ rand ( 0... | Generates relatively random permid for the account |
6,506 | public function parse ( \ ReflectionClass $ aspect , string $ targetClass = null , string $ targetMethod = null ) { if ( $ this -> annotationReader -> getClassAnnotation ( $ aspect , Aop \ Aspect :: class ) === null ) { return false ; } $ advices = [ 'before' => [ ] , 'after' => [ ] , 'afterReturn' => [ ] , 'afterThrow... | Parses an aspect class to an advice array optionally filtered by a target class and method . |
6,507 | public function from ( $ tables ) { if ( is_array ( $ tables ) ) { $ this -> from = $ tables ; } else { $ this -> from = array ( $ tables ) ; } return $ this ; } | Add FROM clause |
6,508 | public function getBySiteRootId ( $ siteRootId ) { if ( ! isset ( $ this -> trees [ $ siteRootId ] ) ) { $ tree = $ this -> treeFactory -> factory ( $ siteRootId ) ; $ this -> trees [ $ siteRootId ] = $ tree ; } return $ this -> trees [ $ siteRootId ] ; } | Return tree by siteroot ID . |
6,509 | public function getByNodeId ( $ nodeId ) { foreach ( $ this -> siterootManager -> findAll ( ) as $ siteroot ) { $ tree = $ this -> getBySiteRootId ( $ siteroot -> getId ( ) ) ; if ( $ tree -> has ( $ nodeId ) ) { return $ tree ; } } throw new NodeNotFoundException ( "Tree for node ID $nodeId not found." ) ; } | Get tree by node ID . |
6,510 | public function getByTypeId ( $ typeId , $ type = null ) { $ trees = [ ] ; foreach ( $ this -> siterootManager -> findAll ( ) as $ siteroot ) { $ tree = $ this -> getBySiteRootId ( $ siteroot -> getId ( ) ) ; if ( $ tree -> hasByTypeId ( $ typeId , $ type ) ) { $ trees [ ] = $ tree ; } } return $ trees ; } | Get tree by type ID . |
6,511 | public function applyDefaults ( array $ defaults = [ ] ) { array_map ( function ( $ key ) use ( $ defaults ) { $ this -> set ( $ key , $ this -> get ( $ key , $ defaults [ $ key ] ) ) ; } , array_keys ( $ defaults ) ) ; } | Applies default values |
6,512 | public function registerReference ( stdClass $ variable ) { ( new RegisterReference ( ) ) -> render ( $ this -> pdo , $ this -> info , $ variable , $ this -> output ) ; } | - Change reference and remove old rerence |
6,513 | public static function IsInteger ( $ value ) : bool { return \ is_int ( $ value ) || ( bool ) \ preg_match ( static :: $ rxInt32 , ( string ) $ value ) ; } | Returns if the defined value is usable as integer value . |
6,514 | public function render ( ) { switch ( $ this -> method ) { case PixelType :: HTML : return $ this -> content ; case PixelType :: IFRAME : return $ this -> _renderIframe ( ) ; case PixelType :: IMAGE : case 'image' : return $ this -> _renderImage ( ) ; case PixelType :: JS : case 'javascript' : return $ this -> _renderJ... | Get the pixel content ready to be rendered to the page |
6,515 | public function match ( $ path , $ verb ) { foreach ( $ this -> routes as $ route ) { $ route -> build ( ) ; if ( false !== ( $ routeParams = $ this -> matcher -> match ( $ route -> build ( ) , $ path , $ verb ) ) ) { return [ $ route , $ routeParams ] ; } } return false ; } | Match Matches routes against the given URL path and HTTP verb . If a route matches returns an array containing the route and the route parameters found in the given path . |
6,516 | public function urlFor ( $ criteria , array $ options = [ ] ) { if ( is_array ( $ criteria ) ) { $ pathParams = array_slice ( $ criteria , 1 ) ; $ criteria = array_shift ( $ criteria ) ; } else { $ pathParams = [ ] ; } $ token = new ActionToken ( $ criteria ) ; foreach ( $ this -> routes as $ route ) { $ route -> build... | Get the URL path for a route by providing an action token as array or string . |
6,517 | public function pathFor ( $ name , $ vars = [ ] , array $ options = [ ] ) { if ( $ name == 'base' ) { return $ this -> basePath ; } foreach ( $ this -> routes as $ route ) { $ route -> build ( ) ; if ( $ route -> name ( ) == $ name ) { if ( $ path = $ this -> buildRouteUrl ( $ route , $ vars , $ options ) ) { return $ ... | Get the URL path for a route by providing a route name . |
6,518 | public function getOption ( $ categoryKey , $ optionKey ) { $ this -> requireOptionExists ( $ categoryKey , $ optionKey ) ; return $ this -> options [ $ categoryKey ] [ $ optionKey ] ; } | Get the value of the given option . |
6,519 | public function createCategory ( $ categoryKey ) { $ this -> requireCategoryDoesNotExist ( $ categoryKey ) ; $ this -> validateName ( $ categoryKey ) ; $ this -> optionCategoryModel -> create ( [ 'key' => $ categoryKey ] ) ; $ this -> refresh ( ) ; $ this -> options [ $ categoryKey ] = [ ] ; } | Creates new option category |
6,520 | public function deleteCategory ( $ categoryKey ) { $ this -> requireCategoryExists ( $ categoryKey ) ; $ this -> optionCategoryModel -> destroy ( $ categoryKey ) ; $ this -> refresh ( ) ; unset ( $ this -> options [ $ categoryKey ] ) ; } | Delete the given category |
6,521 | public function deleteOption ( $ categoryKey , $ optionKey ) { $ this -> requireOptionExists ( $ categoryKey , $ optionKey ) ; $ this -> optionModel -> where ( [ 'category_key' => $ categoryKey , 'key' => $ optionKey ] ) -> delete ( ) ; $ this -> refresh ( ) ; unset ( $ this -> options [ $ categoryKey ] [ $ optionKey ]... | Remove the given option |
6,522 | protected function init ( ) { if ( $ this -> cache -> get ( 'options' ) ) { $ this -> options = $ this -> cache -> get ( 'options' ) ; } else { $ this -> extractCategoriesFromModel ( $ this -> optionCategoryModel -> newQuery ( ) -> get ( [ 'key' ] ) -> sortBy ( 'key' ) ) ; $ this -> extractOptionsFromModel ( $ this -> ... | Init options from database or cache |
6,523 | private function optionExists ( $ categoryKey , $ optionKey ) { $ this -> requireCategoryExists ( $ categoryKey ) ; return array_key_exists ( $ optionKey , $ this -> options [ $ categoryKey ] ) ; } | Check if the given option exists |
6,524 | private function requireOptionExists ( $ categoryKey , $ optionKey ) { if ( ! $ this -> optionExists ( $ categoryKey , $ optionKey ) ) { throw new InvalidArgumentException ( 'Option ' . $ optionKey . ' in category ' . $ categoryKey . ' does not exist' ) ; } } | Make sure the given option exists - raise exception if not |
6,525 | public function getPeakMemoryUsage ( ) { return array_reduce ( $ this -> executedStatements , function ( $ v , $ s ) { $ m = $ s -> getEndMemory ( ) ; return $ m > $ v ? $ m : $ v ; } ) ; } | Returns the peak memory usage while performing statements |
6,526 | public function create ( $ class , ClientInterface $ httpClient = null , HttpRequestStack $ httpRequestStack = null ) { $ class = Helper :: getGatewayClassName ( $ class ) ; if ( ! class_exists ( $ class ) ) { throw new RuntimeException ( "Class '$class' not found" ) ; } $ gateway = new $ class ( $ httpClient , $ httpR... | Create a new gateway instance |
6,527 | protected function pullUsernameFromQuery ( Request $ request ) { $ queryUsername = $ request -> query -> get ( 'username' ) ; if ( $ queryUsername ) { if ( strlen ( $ queryUsername ) <= Security :: MAX_USERNAME_LENGTH ) { $ request -> getSession ( ) -> set ( Security :: LAST_USERNAME , $ queryUsername ) ; } } } | Populates the last username in the session based on the query param username . |
6,528 | protected function isRegistrationEnabled ( ) { $ router = $ this -> container -> get ( 'router' ) ; if ( get_class ( $ router ) == 'JMS\I18nRoutingBundle\Router\I18nRouter' ) { $ routes = $ router -> getOriginalRouteCollection ( ) ; } else { $ routes = $ router -> getRouteCollection ( ) ; } return ( null !== $ routes -... | Returns true when registration is enabled . |
6,529 | protected function isFilterLocked ( string $ name ) : bool { return isset ( $ this -> filtersLock [ $ name ] ) && $ this -> filtersLock [ $ name ] ? true : false ; } | Check whether filter is locked . |
6,530 | public function distance ( LatLng $ to ) { $ er = 6366.707 ; $ latFrom = deg2rad ( $ this -> lat ) ; $ latTo = deg2rad ( $ to -> lat ) ; $ lngFrom = deg2rad ( $ this -> lng ) ; $ lngTo = deg2rad ( $ to -> lng ) ; $ x1 = $ er * cos ( $ lngFrom ) * sin ( $ latFrom ) ; $ y1 = $ er * sin ( $ lngFrom ) * sin ( $ latFrom ) ;... | Calculate the surface distance between this LatLng object and the one passed in as a parameter . |
6,531 | public function OSGB36ToWGS84 ( ) { $ airy1830 = new ReferenceEllipsoid ; $ a = $ airy1830 -> maj ; $ b = $ airy1830 -> min ; $ eSquared = $ airy1830 -> ecc ; $ phi = deg2rad ( $ this -> lat ) ; $ lambda = deg2rad ( $ this -> lng ) ; $ v = $ a / ( sqrt ( 1 - $ eSquared * Trig :: sinSquared ( $ phi ) ) ) ; $ H = 0 ; $ x... | Convert this LatLng object from OSGB36 datum to WGS84 datum . |
6,532 | public function getUTMLatitudeZoneLetter ( $ latitude ) { if ( ( 84 >= $ latitude ) && ( $ latitude >= 72 ) ) { return 'X' ; } if ( ( 72 > $ latitude ) && ( $ latitude >= 64 ) ) { return 'W' ; } if ( ( 64 > $ latitude ) && ( $ latitude >= 56 ) ) { return 'V' ; } if ( ( 56 > $ latitude ) && ( $ latitude >= 48 ) ) { retu... | Work out the UTM latitude zone from the latitude |
6,533 | public function postContent ( $ type = 'content' ) { $ output = [ ] ; if ( $ type === 'excerpt' ) { ob_start ( ) ; the_excerpt ( ) ; $ output [ ] = ob_get_clean ( ) ; } else { ob_start ( ) ; the_content ( sprintf ( __ ( 'Continue reading %s' , 'novusopress' ) , the_title ( '<span class="sr-only">' , '</span>' , false )... | Retrieves the content for posts |
6,534 | public function attachmentContent ( ) { $ output = [ ] ; if ( wp_attachment_is_image ( ) ) { $ output [ ] = sprintf ( '<div class="attachment-image">%s</div>' , wp_get_attachment_image ( get_the_ID ( ) , apply_filters ( 'novusopress_view_attachment_image_size' , 'medium' ) ) ) ; } else { $ output [ ] = sprintf ( '<div ... | Retrieves the content for attachments |
6,535 | public function siteNameHeading ( array $ args = [ ] ) { $ defaults = [ 'id' => 'site-name' , 'class' => 'site-name' , 'homeEl' => 'h1' , 'pageEl' => 'h3' ] ; $ args = wp_parse_args ( $ args , $ defaults ) ; extract ( $ args , EXTR_SKIP ) ; $ el = ( is_front_page ( ) || is_home ( ) ) ? $ homeEl : $ pageEl ; $ output = ... | Retrieves the site name heading |
6,536 | public function logoExists ( $ filename = 'logo.png' ) { $ framework = Framework :: instance ( ) ; if ( file_exists ( sprintf ( '%s/img/%s' , $ framework -> getThemeAssetsDir ( ) , $ filename ) ) ) { return true ; } return false ; } | Checks if the logo image exists |
6,537 | public function logo ( $ filename = 'logo.png' , $ linked = true ) { $ framework = Framework :: instance ( ) ; $ output = [ ] ; if ( file_exists ( sprintf ( '%s/img/%s' , $ framework -> getThemeAssetsDir ( ) , $ filename ) ) ) { if ( $ linked ) { $ output [ ] = sprintf ( '<a href="%s" alt="%s logo">' , esc_url ( home_u... | Retrieves the logo markup |
6,538 | public function featuredImage ( ) { if ( ! has_post_thumbnail ( ) || post_password_required ( ) || is_attachment ( ) ) { $ output = '' ; } else { if ( is_singular ( ) ) { $ output = get_the_post_thumbnail ( ) ; } else { $ output = get_the_post_thumbnail ( null , 'post-thumbnail' , [ 'alt' => get_the_title ( ) ] ) ; } }... | Retrieves the featured image |
6,539 | public function blogTitle ( ) { if ( get_option ( 'page_for_posts' ) ) { $ blogPageId = get_option ( 'page_for_posts' ) ; $ output = get_the_title ( $ blogPageId ) ; } else { $ output = '' ; } return apply_filters ( 'novusopress_view_blog_title_output' , $ output ) ; } | Retrieves the blog title |
6,540 | public function archiveTitle ( ) { if ( is_category ( ) ) { $ output = sprintf ( '%s: %s' , __ ( 'Category' , 'novusopress' ) , single_cat_title ( '' , false ) ) ; } elseif ( is_tag ( ) ) { $ output = sprintf ( '%s: %s' , __ ( 'Tag' , 'novusopress' ) , single_tag_title ( '' , false ) ) ; } elseif ( is_day ( ) ) { $ out... | Retrieves the archive title |
6,541 | public function dynamicSidebar ( ) { ob_start ( ) ; dynamic_sidebar ( sprintf ( 'sidebar-%s' , $ this -> template ) ) ; $ output = ob_get_clean ( ) ; return apply_filters ( 'novusopress_view_dynamic_sidebar_output' , $ output ) ; } | Retrieves the dynamic sidebar output |
6,542 | public function mainMenu ( array $ args = [ ] ) { $ defaults = [ 'searchForm' => false , 'btnColor' => 'default' , 'containerEl' => 'div' , 'containerId' => 'navbar-collapse-main-menu' , 'containerClass' => 'navbar-collapse-main-menu navbar-collapse collapse' , 'menuEl' => 'ul' , 'menuId' => 'navbar-main-menu' , 'menuC... | Retrieves the main menu |
6,543 | public function displayBreadcrumbs ( ) { if ( ! Framework :: instance ( ) -> getThemeOption ( 'display_breadcrumbs' ) ) { return false ; } if ( ! is_front_page ( ) && ! ( is_home ( ) && 'page' !== get_option ( 'show_on_front' ) ) ) { return true ; } return false ; } | Checks whether or not to display breadcrumbs |
6,544 | public function comments ( ) { $ output = [ ] ; if ( comments_open ( ) || get_comments_number ( ) ) { ob_start ( ) ; comments_template ( ) ; $ output [ ] = ob_get_clean ( ) ; } return apply_filters ( 'novusopress_view_comments_output' , implode ( '' , $ output ) ) ; } | Retrieves the comments template |
6,545 | public function postFormatMeta ( ) { $ output = [ ] ; $ format = get_post_format ( ) ; if ( current_theme_supports ( 'post-formats' , $ format ) ) { $ output [ ] = '<div class="meta-format">' ; $ output [ ] = sprintf ( '<span class="entry-format">%s<a href="%s">%s</a></span>' , sprintf ( '<span class="sr-only">%s</span... | Retrieves the post format meta |
6,546 | public function postTimeMeta ( ) { $ output = [ ] ; if ( in_array ( get_post_type ( ) , [ 'post' , 'attachment' ] ) ) { $ timeString = '<time class="entry-date published" datetime="%1$s">%2$s</time>' ; $ timeString = sprintf ( $ timeString , esc_attr ( get_the_date ( 'c' ) ) , get_the_date ( ) ) ; $ output [ ] = '<div ... | Retrieves the post time meta |
6,547 | public function postClassificationMeta ( ) { $ output = [ ] ; if ( 'post' === get_post_type ( ) ) { $ output [ ] = '<ul class="entry-classification list-inline">' ; $ categoriesList = get_the_category_list ( '</span> <span class="label label-primary"><span class="fa fa-folder"></span> ' ) ; if ( $ categoriesList ) { $ ... | Retrieves the post classification meta |
6,548 | public function commentsPopupLink ( ) { $ output = [ ] ; if ( is_single ( ) || post_password_required ( ) || ( ! comments_open ( ) || ! get_comments_number ( ) ) ) { return '' ; } ob_start ( ) ; comments_popup_link ( __ ( 'Leave a comment' , 'novusopress' ) , sprintf ( __ ( '%1$s1%2$s Comment' , 'novusopress' ) , '<spa... | Retrieves the comments popup link |
6,549 | public function imageAttachmentLink ( ) { $ output = [ ] ; if ( is_attachment ( ) && wp_attachment_is_image ( ) ) { $ metadata = wp_get_attachment_metadata ( ) ; $ output [ ] = sprintf ( '<span class="full-size-link"><span class="sr-only">%s</span><a href="%s">%s × %s</a></span>' , _x ( 'Full size' , 'Used before... | Retrieves the image attachment link |
6,550 | public function bodyClass ( $ classes = [ ] ) { $ classes = ! is_array ( $ classes ) ? explode ( ' ' , $ classes ) : $ classes ; $ classes = get_body_class ( $ classes ) ; if ( Framework :: instance ( ) -> getThemeOption ( 'navbar_location' ) === 'fixed' ) { $ classes [ ] = 'fixed-nav' ; } $ classes = apply_filters ( '... | Retrieves the body classes |
6,551 | public function wrapperClass ( $ classes = [ ] ) { $ classes = ! is_array ( $ classes ) ? explode ( ' ' , $ classes ) : $ classes ; $ classes [ ] = 'wrapper' ; $ classes [ ] = sprintf ( 'template-%s' , $ this -> template ) ; if ( is_active_sidebar ( sprintf ( 'sidebar-%s' , $ this -> template ) ) ) { $ classes [ ] = 'a... | Retrieves the wrapper classes |
6,552 | public function contentClass ( $ classes = [ ] ) { $ classes = ! is_array ( $ classes ) ? explode ( ' ' , $ classes ) : $ classes ; $ classes [ ] = sprintf ( 'main-%s' , $ this -> template ) ; $ classes [ ] = 'main-content' ; if ( is_active_sidebar ( sprintf ( 'sidebar-%s' , $ this -> template ) ) ) { $ classes [ ] = '... | Retrieves the content classes |
6,553 | public function postClass ( $ classes = [ ] ) { $ classes = ! is_array ( $ classes ) ? explode ( ' ' , $ classes ) : $ classes ; $ classes [ ] = 'content-node' ; $ classes = apply_filters ( 'novusopress_view_post_classes' , get_post_class ( $ classes ) ) ; $ output = sprintf ( 'class="%s"' , implode ( ' ' , $ classes )... | Retrieves the post classes |
6,554 | public function sidebarClass ( $ classes = [ ] ) { $ classes = ! is_array ( $ classes ) ? explode ( ' ' , $ classes ) : $ classes ; $ classes [ ] = sprintf ( 'sidebar-%s' , $ this -> template ) ; $ classes [ ] = 'sidebar' ; $ classes [ ] = 'col-sm-4 col-md-3' ; $ classes = apply_filters ( 'novusopress_view_sidebar_clas... | Retrieves the sidebar classes |
6,555 | public function footerClass ( $ classes = [ ] ) { $ classes = ! is_array ( $ classes ) ? explode ( ' ' , $ classes ) : $ classes ; $ classes [ ] = 'footer-area' ; $ i = 0 ; if ( is_active_sidebar ( 'footer-one' ) ) $ i ++ ; if ( is_active_sidebar ( 'footer-two' ) ) $ i ++ ; if ( is_active_sidebar ( 'footer-three' ) ) $... | Retrieves the footer classes |
6,556 | protected function getNavbarSearchForm ( $ btnColor ) { $ action = esc_url ( home_url ( '/' ) ) ; $ label = __ ( 'Search for' , 'novusopress' ) ; $ placeholder = __ ( 'Search' , 'novusopress' ) ; $ form = <<<EOT <form id="navbar-search-form" method="get" action="$action" class="navbar-form navbar-right" rol... | Retrieves the markup for the navbar search form |
6,557 | public function api ( array $ attributes , Closure $ callback ) { $ attributes [ 'prefix' ] = array_key_exists ( 'prefix' , $ attributes ) ? sprintf ( '%s/%s' , 'api' , $ attributes [ 'prefix' ] ) : 'api' ; parent :: group ( $ attributes , $ callback ) ; } | Registar rota de API . |
6,558 | public static function registerErrorHandler ( Logger $ logger , $ continueNativeHandler = false ) { if ( self :: $ registeredErrorHandler ) { return false ; } if ( $ logger === null ) { throw new \ Zend \ Log \ Exception \ InvalidArgumentException ( 'Invalid Logger specified' ) ; } $ errorHandlerMap = [ E_NOTICE => sel... | Registers an error handler for PHP errors |
6,559 | public static function registerExceptionHandler ( Logger $ logger ) { if ( self :: $ registeredExceptionHandler ) { return false ; } if ( $ logger === null ) { throw new \ Zend \ Log \ Exception \ InvalidArgumentException ( 'Invalid Logger specified' ) ; } set_exception_handler ( function ( \ Exception $ exception ) us... | Registers an exception handler |
6,560 | public function dispatchError ( \ Zend \ Mvc \ MvcEvent $ e ) { $ error = $ e -> getError ( ) ; if ( empty ( $ error ) ) { return ; } $ result = $ e -> getResult ( ) ; if ( $ result instanceof \ Zend \ Stdlib \ ResponseInterface ) { return ; } switch ( $ error ) { case \ Zend \ Mvc \ Application :: ERROR_CONTROLLER_NOT... | Logs any dispatch exceptions |
6,561 | public static function registerHandlers ( $ logFile = 'error.log' , $ logDir = 'data/logs' ) { $ logger = new self ( $ logFile , $ logDir ) ; self :: registerErrorHandler ( $ logger , true ) ; self :: registerExceptionHandler ( $ logger ) ; } | Registers the handlers for errors and exceptions |
6,562 | protected function loadFactorableInstance ( string $ factorableClassName ) { $ factorable = $ this -> instanciateFactorable ( $ factorableClassName ) ; $ factorable -> setFactory ( $ this ) ; $ this -> injectDependancies ( $ factorable ) ; $ this -> injectServices ( $ factorable ) ; return $ factorable ; } | Loads a factorable instance |
6,563 | protected function injectServices ( FactorableInterface $ factorable ) { if ( $ factorable instanceof DependenciesAwareInterface ) { foreach ( $ factorable -> getDependencies ( ) as $ prop => $ value ) { $ reflectionProperty = new \ ReflectionProperty ( get_class ( $ factorable ) , $ prop ) ; $ reflectionProperty -> se... | Inject services in factorable if it requires any |
6,564 | public function getFactorableInstance ( string $ factorableClassName ) { $ factorable = $ this -> loadFactorableInstance ( $ factorableClassName ) ; $ this -> onFactorableLoaded ( $ factorable ) ; return $ factorable ; } | Instanciate a factorable from a class name and inject its dependancies . |
6,565 | public static function register ( interfaces \ handlers \ Error $ handler = null , int $ threshold = null ) { $ handler = $ handler ? : new static ( $ threshold ) ; set_error_handler ( [ $ handler , 'handle' ] ) ; if ( $ handler instanceof interfaces \ handlers \ Shutdown ) { register_shutdown_function ( [ $ handler , ... | Registers the given or a new Error Handler with PHP . |
6,566 | public function setThreshold ( int $ threshold = null ) : self { $ this -> threshold = null === $ threshold ? error_reporting ( ) : $ threshold ; return $ this ; } | Sets the error severity required to convert an error into an Exception . |
6,567 | protected function isFatal ( int $ type ) { return in_array ( $ type , [ E_ERROR , E_CORE_ERROR , E_COMPILE_ERROR , E_USER_ERROR , E_RECOVERABLE_ERROR , E_PARSE ] ) ; } | Determines if given error type is considered a fatal error . |
6,568 | public function addMapping ( string $ className , string $ identifier ) : Mapper { if ( class_exists ( $ className ) === false ) { throw new ClassNotExists ( $ className ) ; } $ this -> mapping [ $ identifier ] = $ className ; return $ this ; } | Add class name for identifier . |
6,569 | public function rules ( ) { $ this -> buildForm ( ) ; $ this -> extendForm ( ) ; $ rules = [ ] ; foreach ( $ this -> fields ( ) as $ field ) { if ( ! is_null ( $ field -> getRules ( ) ) ) { $ rules [ $ field -> getName ( ) ] = $ field -> getRules ( ) ; } } return $ rules ; } | Retrive the validation rules that are added to the form . |
6,570 | private function readForm ( ) { foreach ( $ this -> fields as $ field ) { $ field -> setForm ( $ this ) ; if ( $ field -> hasError ( ) ) { $ field -> addClass ( 'is-invalid' ) ; } if ( $ old = $ this -> request -> old ( $ field -> getName ( ) ) ) { $ field -> value ( $ old ) ; } } } | Extends the form for addtional fields |
6,571 | public function settings ( $ settings = null ) { if ( is_null ( $ settings ) ) { return $ this -> settings ; } $ this -> settings = $ settings ; return $ this ; } | Add or Retrive Settings of the form . |
6,572 | public function getError ( $ field ) { if ( ! $ this -> hasError ( $ field ) ) { return null ; } return $ this -> getErrors ( ) -> first ( $ field ) ; } | Get the field error . |
6,573 | public function fileSize ( String $ path , String $ type = 'b' , Int $ decimal = 2 ) : Float { $ size = 0 ; $ extension = Filesystem :: getExtension ( $ path ) ; if ( ! empty ( $ extension ) ) { $ size = ftp_size ( $ this -> connect , $ path ) ; } else { if ( $ this -> files ( $ path ) ) { foreach ( $ this -> files ( $... | Get File Size |
6,574 | public function load ( $ criteria ) { $ pool = $ this -> manager -> getPool ( ) ; $ manager_id = $ this -> class -> getManagerIdentifier ( ) ; if ( ! is_array ( $ criteria ) ) { $ criteria = array ( $ this -> class -> getFieldIdentifier ( ) => $ criteria ) ; } $ model = $ pool -> getManager ( $ manager_id ) -> getRepos... | Loads an multi - model by a list of field criteria . |
6,575 | public function loadAll ( array $ criteria = array ( ) , array $ orderBy = null , $ limit = null , $ offset = null ) { $ pool = $ this -> manager -> getPool ( ) ; $ manager_id = $ this -> class -> getManagerIdentifier ( ) ; $ models = array ( ) ; foreach ( $ this -> class -> getFieldManagerNames ( ) as $ manager ) { $ ... | Loads a list of model by a list of field criteria . |
6,576 | public function getDescriptorFor ( $ entity ) { return $ this -> descriptors -> containsKey ( $ entity ) ? $ this -> descriptors -> get ( $ entity ) : $ this -> createDescriptor ( $ entity ) ; } | Returns the descriptor for provided class name |
6,577 | private function createDescriptor ( $ entityClass ) { $ descriptor = new EntityDescriptor ( $ entityClass ) ; $ this -> descriptors -> set ( $ entityClass , $ descriptor ) ; return $ descriptor ; } | Creates an entity descriptor for provided class name |
6,578 | public function mapDeviceName ( ? string $ deviceName ) : ? string { if ( null === $ deviceName ) { return null ; } $ marketingName = null ; switch ( mb_strtolower ( $ deviceName ) ) { case '' : case 'unknown' : case 'other' : case 'various' : case 'android 1.6' : case 'android 2.0' : case 'android 2.1' : case 'android... | maps the marketing name of a device from the device name |
6,579 | private function defaultUserAgent ( ) { static $ defaultAgent ; if ( $ defaultAgent === null ) { $ defaultAgent = sprintf ( 'Pletfix/%s curl/%s PHP/%s' , Application :: VERSION , curl_version ( ) [ 'version' ] , PHP_VERSION ) ; } return $ defaultAgent ; } | Get the default User - Agent |
6,580 | public function addSelector ( $ key , FullMethodIdentifier $ fullMethodId ) { if ( $ this -> noIdentifierFor ( $ key ) ) { $ this -> fullMethodIdentifierByKey [ $ key ] = [ ] ; } $ this -> fullMethodIdentifierByKey [ $ key ] [ ] = $ fullMethodId ; } | Stores some full method identifier under some given string key . |
6,581 | public function toBePresent ( ) { $ this -> wait ( ) -> until ( WebDriverExpectedCondition :: presenceOfElementLocated ( $ this -> elementFinder -> getSearchCriteria ( ) ) ) ; return $ this ; } | Asserts that the element exists in the DOM . |
6,582 | public function toBeVisible ( ) { $ this -> wait ( ) -> until ( WebDriverExpectedCondition :: visibilityOfElementLocated ( $ this -> elementFinder -> getSearchCriteria ( ) ) ) ; return $ this ; } | Asserts that the elements exists in the DOM and is visible to the user . |
6,583 | public function toBeInvisible ( ) { $ this -> wait ( ) -> until ( WebDriverExpectedCondition :: invisibilityOfElementLocated ( $ this -> elementFinder -> getSearchCriteria ( ) ) ) ; return $ this ; } | Asserts that the element exists in the DOM and is not visible to the user . |
6,584 | public function toBeClickable ( ) { $ this -> wait ( ) -> until ( WebDriverExpectedCondition :: elementToBeClickable ( $ this -> elementFinder -> getSearchCriteria ( ) ) ) ; return $ this ; } | Asserts that the element exists in the DOM and is clickable by the user . |
6,585 | public function toBeSelected ( ) { $ this -> wait ( ) -> until ( WebDriverExpectedCondition :: elementToBeSelected ( $ this -> elementFinder -> getSearchCriteria ( ) ) ) ; return $ this ; } | Asserts that the element exists in the DOM and is selected . |
6,586 | public function persist ( ) : void { if ( $ this -> statements ) { $ this -> loader -> addOperation ( static :: DESCRIPTION , $ this -> statements ) ; $ this -> statements = [ ] ; } } | Persist all default statements to the Loader . |
6,587 | public function initialise ( $ options ) { $ app = JFactory :: getApplication ( ) ; $ options = JArrayHelper :: toObject ( $ options ) ; $ lang = JFactory :: getLanguage ( ) ; $ currentLang = $ lang -> getTag ( ) ; if ( JLanguage :: exists ( $ currentLang , JPATH_ADMINISTRATOR ) ) { $ lang -> load ( 'joomla' , JPATH_AD... | Method to initialise the database . |
6,588 | public function beforeValidate ( $ event ) { parent :: beforeValidate ( $ event ) ; if ( $ this -> owner -> hasAttribute ( $ this -> statusAttribute ) && ! isset ( $ this -> owner -> { $ this -> statusAttribute } ) ) { $ this -> owner -> { $ this -> statusAttribute } = $ this -> defaultStatus ; } } | Actions to take before validating the owner . |
6,589 | public function getStatusId ( ) { if ( ! $ this -> owner -> hasAttribute ( $ this -> statusAttribute ) ) { throw new CException ( 'Failed to get status id. Status attribute does not exist.' ) ; } return $ this -> owner -> { $ this -> statusAttribute } ; } | Returns the current status id of the owner . |
6,590 | public function getStatusName ( $ id = null ) { $ options = $ this -> getStatusOptions ( ) ; if ( ! isset ( $ id ) ) { $ id = $ this -> getStatusId ( ) ; } return isset ( $ options [ $ id ] ) ? $ options [ $ id ] : '???' ; } | Returns the name of the status with the given id . |
6,591 | public function getStatusConfig ( $ id = null ) { if ( ! isset ( $ id ) ) { $ id = $ this -> getStatusId ( ) ; } return isset ( $ this -> statuses [ $ id ] ) ? $ this -> statuses [ $ id ] : array ( ) ; } | Returns the status configuration for the given status id . |
6,592 | public function getStatusOptions ( ) { $ options = array ( ) ; foreach ( $ this -> statuses as $ id => $ status ) { if ( isset ( $ status [ 'label' ] ) ) { $ options [ $ id ] = $ status [ 'label' ] ; } } return $ options ; } | Returns the options for all available statuses . |
6,593 | public function getAllowedStatusOptions ( ) { $ options = array ( ) ; $ config = $ this -> getStatusConfig ( ) ; if ( isset ( $ config [ 'transitions' ] ) && is_array ( $ config [ 'transitions' ] ) ) { foreach ( $ config [ 'transitions' ] as $ id ) { $ options [ $ id ] = $ this -> getStatusName ( $ id ) ; } } return $ ... | Returns the options for the allowed statuses . |
6,594 | public function isTransitionAllowed ( $ oldStatus , $ newStatus ) { $ config = $ this -> statuses [ $ oldStatus ] ; return isset ( $ config [ 'transitions' ] ) && is_array ( $ config [ 'transitions' ] ) && in_array ( $ newStatus , $ config [ 'transitions' ] ) ; } | Returns whether the transition between the given statuses is allowed . |
6,595 | public function loadClassMetadata ( LoadClassMetadataEventArgs $ args ) { $ metadata = $ args -> getClassMetadata ( ) ; $ className = $ metadata -> getName ( ) ; if ( in_array ( $ className , $ this -> classesLoaded ) ) { return ; } $ this -> classesLoaded [ ] = $ className ; if ( $ metadata -> customRepositoryClassNam... | Load repository data according to doctrine mapping information |
6,596 | public function get ( Request $ request , Fractal $ fractal ) { $ this -> beforeRequest ( $ request , func_get_args ( ) ) ; $ id = $ this -> parseObjectId ( $ request ) ; $ model = $ this -> loadAuthorizeObject ( $ id , 'read' ) ; $ include = $ request -> input ( 'include' , '' ) ; return $ this -> respondWithItem ( $ ... | Get the object |
6,597 | public function getBasePath ( ) : ? string { if ( ! $ this -> hasBasePath ( ) ) { $ this -> setBasePath ( $ this -> getDefaultBasePath ( ) ) ; } return $ this -> basePath ; } | Get base path |
6,598 | public function set_parent ( Node_Container $ parent = null ) { $ this -> parent = $ parent ; if ( $ parent instanceof Node_Container_Document ) $ this -> root = $ parent ; else $ this -> root = $ parent -> root ( ) ; } | Sets the nodes parent |
6,599 | public function find_parent_by_tag ( $ tag ) { $ node = $ this -> parent ( ) ; while ( $ this -> parent ( ) != null && ! $ node instanceof Node_Container_Document ) { if ( $ node -> tag ( ) === $ tag ) return $ node ; $ node = $ node -> parent ( ) ; } return null ; } | Finds a parent node of the passed type . Returns null if none found . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.