idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
238,700 | public function addMerged ( $ file_path , $ media = 'screen' ) { $ _fp = $ this -> __template -> findAsset ( $ file_path ) ; if ( $ _fp || \ AssetsManager \ Loader :: isUrl ( $ file_path ) ) { $ this -> registry -> addEntry ( array ( 'file' => $ _fp , 'media' => $ media ) , 'css_merged_files' ) ; } else { throw new \ I... | Add an merged file |
238,701 | public function writeMinified ( $ mask = '%s' ) { $ str = '' ; foreach ( $ this -> cleanStack ( $ this -> getMinified ( ) , 'file' ) as $ entry ) { $ tag_attrs = array ( 'rel' => 'stylesheet' , 'type' => 'text/css' , 'href' => $ entry [ 'file' ] ) ; if ( isset ( $ entry [ 'media' ] ) && ! empty ( $ entry [ 'media' ] ) ... | Write minified versions of the files stack in the cache directory |
238,702 | protected function form ( Model $ model ) { $ this -> breadcrumb -> onItem ( $ model ) ; return app ( 'antares.form' ) -> of ( 'awesone-module-form' , function ( FormGrid $ form ) use ( $ model ) { $ form -> name ( 'My Awesome Module Form' ) ; $ form -> resourced ( 'antares::sample_module/index' , $ model ) ; $ form ->... | Generowanie nowego obiektu formularza |
238,703 | public function store ( ) { $ input = Input :: all ( ) ; $ user = auth ( ) -> user ( ) ; $ attributes = [ 'user_id' => $ user -> hasRoles ( 'member' ) ? $ user -> id : array_get ( $ input , 'user' ) , 'name' => array_get ( $ input , 'name' ) , 'value' => array_only ( $ input , [ 'field_1' , 'field_2' ] ) ] ; $ model = ... | When stores form fields in database |
238,704 | public function update ( $ id ) { $ model = ModuleRow :: withoutGlobalScopes ( ) -> findOrFail ( $ id ) ; if ( ! request ( ) -> isMethod ( 'put' ) ) { $ form = $ this -> form ( $ model ) ; } else { $ input = Input :: all ( ) ; $ user = auth ( ) -> user ( ) ; if ( ! $ user -> hasRoles ( 'member' ) ) { $ model -> user_id... | When updates form fields in database |
238,705 | public function delete ( $ id ) { $ builder = ModuleRow :: withoutGlobalScopes ( ) ; if ( auth ( ) -> user ( ) -> hasRoles ( 'member' ) ) { $ builder -> where ( [ 'user_id' => auth ( ) -> user ( ) -> id ] ) ; } $ model = $ builder -> findOrFail ( $ id ) ; $ name = $ model -> name ; if ( $ model -> delete ( ) ) { event ... | When deletes item |
238,706 | public function cast ( $ model ) { if ( $ model instanceof Collection ) { return $ model -> map ( [ $ this , 'cast' ] ) -> toArray ( ) ; } if ( empty ( $ model ) ) { return ; } $ transformed = [ ] ; foreach ( $ this -> castRules ( ) as $ old => $ desired ) { $ this -> resolveCast ( $ old , $ desired , $ model , $ trans... | Casts collection fields . |
238,707 | private function resolveCast ( $ old , $ desired , Model $ model , & $ transformed ) { if ( $ desired instanceof Closure ) { return $ transformed [ $ old ] = call_user_func ( $ desired , $ model ) ; } if ( is_string ( $ desired ) && strpos ( $ desired , $ this -> functionSign ) !== false ) { return $ transformed [ $ ol... | Resolves casts based on supplied array of arguments . |
238,708 | protected function render ( ) { if ( null === $ this -> active ) { $ this -> setActive ( key ( $ this -> tabs ) ) ; } $ tabs = new ViewModel ; $ tabs -> tabs = $ this -> tabs ; $ tabs -> setTemplate ( 'sxbootstrap/tabs/tabs' ) ; return $ this -> getView ( ) -> render ( $ tabs ) ; } | Renders the tabs and returns the markup . |
238,709 | public function add ( $ label , $ content = null , $ tabId = null , $ active = false ) { $ tabId = is_null ( $ tabId ) ? $ this -> getTabId ( ) : $ tabId ; $ label = is_null ( $ label ) ? $ tabId : $ label ; $ this -> tabs [ $ tabId ] = array ( 'label' => $ label , 'content' => $ content , 'active' => $ active , ) ; re... | Add a new tab . |
238,710 | protected function getTabId ( $ current = false ) { if ( true === $ current ) { return key ( $ this -> tabs ) ; } $ c = $ this -> tabCount ++ ; return $ this -> defaultTabIdentifier . $ c ; } | Generate an id for a tab or get the last added one . |
238,711 | public function query ( ) { if ( $ this -> result === null ) { $ this -> before_called = true ; foreach ( $ this -> before_query as $ callable ) { $ callable ( ) ; } try { $ this -> result = $ this -> query -> query ( ) ; $ this -> result -> setFetchMode ( \ PDO :: FETCH_ASSOC ) ; } catch ( \ Smalldb \ Flupdo \ FlupdoS... | Execute SQL query or do whatever is required to get this listing populated . |
238,712 | public function fetchAll ( ) { if ( $ this -> result === null ) { $ this -> query ( ) ; } $ machine = $ this -> machine ; $ id_keys = $ this -> machine -> describeId ( ) ; if ( count ( $ id_keys ) == 1 ) { $ list = array ( ) ; while ( ( $ properties = $ this -> result -> fetch ( \ PDO :: FETCH_ASSOC ) ) ) { $ item = $ ... | Returns an array of all items in the listing . |
238,713 | protected function calculateAdditionalFiltersData ( & $ filters ) { if ( ! empty ( $ this -> additional_filters_data ) ) { foreach ( $ this -> additional_filters_data as $ f => $ src ) { if ( isset ( $ src [ 'query' ] ) ) { $ filters [ $ f ] = $ this -> query -> pdo -> query ( $ src [ 'query' ] ) -> fetchColumn ( ) ; }... | Calculate additional filter data . |
238,714 | protected function setupSphinxSearch ( $ filter_name , $ value , $ machine_filter ) { $ sphinx_key_column = $ this -> query -> quoteIdent ( $ machine_filter [ 'sphinx_key_column' ] ) ; $ temp_table = $ this -> query -> quoteIdent ( '_sphinx_temp_' . $ filter_name ) ; $ index_name = $ this -> query -> quoteIdent ( $ mac... | Setup query for lookup in Sphinx search engine . |
238,715 | public function setValue ( $ value ) { switch ( $ this -> type ) { case self :: TYPE_BOOLEAN : $ this -> value = ( bool ) $ value ; break ; case self :: TYPE_STRING : $ this -> value = ( string ) $ value ; break ; } return $ this ; } | Option value setter |
238,716 | public function send ( ConversionInterface $ conversion ) : ResponseInterface { if ( ! $ conversion instanceof Conversion ) { throw new UnsupportedConversionTypeException ( $ this , $ conversion ) ; } $ previousSentConversion = $ this -> repository -> pull ( $ conversion -> getId ( ) , get_class ( $ conversion ) ) ; if... | Sending POST query to CPA network after creating conversion |
238,717 | public function getPersister ( $ key ) { if ( empty ( $ key ) || false === $ this -> hasPersister ( $ key ) ) { throw PersisterException :: persisterNotFound ( $ key ) ; } return $ this -> persisters [ $ key ] ; } | Gets a Persister service by key . |
238,718 | public function getSearchClient ( $ key ) { if ( empty ( $ key ) || false === $ this -> hasSearchClient ( $ key ) ) { throw ClientException :: clientNotFound ( $ key ) ; } return $ this -> searchClients [ $ key ] ; } | Gets a Search Client service by key . |
238,719 | public function check ( $ hostname ) { $ result = array ( ) ; foreach ( $ this -> getBlServers ( ) as $ blServer ) { $ result [ ] = $ blServer -> getResolver ( ) -> execute ( $ hostname ) ; } return $ result ; } | Check hostname in all bl servers |
238,720 | public function checkIP ( $ ip ) { $ result = array ( ) ; foreach ( $ this -> getBlServers ( ) as $ blServer ) { if ( $ blServer -> supportIPv4 ( ) ) { $ result [ ] = $ blServer -> getResolver ( ) -> execute ( $ ip ) ; } } return $ result ; } | Check IP in black list |
238,721 | public function checkDomain ( $ hostname ) { $ result = array ( ) ; foreach ( $ this -> getBlServers ( ) as $ blServer ) { if ( $ blServer -> supportDomain ( ) ) { $ result [ ] = $ blServer -> getResolver ( ) -> execute ( $ hostname ) ; } } return $ result ; } | Check domain name in black list |
238,722 | public function set ( array $ tags ) { if ( ! empty ( $ tags ) ) { foreach ( $ tags as $ _tag ) { $ this -> add ( $ _tag ) ; } } return $ this ; } | Set a full links header stack |
238,723 | public function getImageStorage ( $ image ) { if ( @ file_exists ( 'file://' . $ image ) ) { return DriverInterface :: IMAGE_STORAGE_FILE ; } elseif ( false === strpos ( $ image , '://' ) ) { return DriverInterface :: IMAGE_STORAGE_STRING ; } else { return DriverInterface :: IMAGE_STORAGE_URL ; } } | Get storage type of image |
238,724 | public function getInfo ( $ image ) { if ( DriverInterface :: IMAGE_STORAGE_STRING == $ this -> getImageStorage ( $ image ) ) { $ image = 'data://application/octet-stream;base64,' . base64_encode ( $ image ) ; } return getimagesize ( $ image ) ; } | Get info of image |
238,725 | public function ensure ( $ image , $ formats , $ storages ) { $ storage = $ this -> getImageStorage ( $ image ) ; $ format = $ this -> getImageFormat ( $ image ) ; $ storages = is_string ( $ storages ) ? array ( $ storages ) : $ storages ; $ formats = is_int ( $ formats ) ? array ( $ formats ) : $ formats ; if ( in_arr... | Ensure certain image storages und formats |
238,726 | protected function getFileOptionForSaving ( $ storages ) { if ( in_array ( DriverInterface :: IMAGE_STORAGE_STRING , $ storages ) ) { return null ; } elseif ( in_array ( DriverInterface :: IMAGE_STORAGE_FILE , $ storages ) ) { return sys_get_temp_dir ( ) . '/tmp-image-' . rand ( ) ; } else { throw new Exception \ Runti... | Get file option from storages for saving |
238,727 | public function loadToString ( $ image ) { $ srcStorage = $ this -> getImageStorage ( $ image ) ; if ( $ srcStorage !== DriverInterface :: IMAGE_STORAGE_STRING ) { $ image = @ file_get_contents ( $ image ) ; if ( false === $ image ) { throw new Exception \ RuntimeException ( 'could not load image' ) ; } } return $ imag... | Load image to string |
238,728 | public function saveFromString ( $ image , $ options = array ( ) ) { if ( isset ( $ options [ 'file' ] ) ) { if ( false === @ file_put_contents ( $ options [ 'file' ] , $ image ) ) { throw new Exception \ RuntimeException ( 'could not save image' ) ; } return $ options [ 'file' ] ; } return $ image ; } | Save image from string |
238,729 | public function getAllowedDbValues ( array $ except = [ ] ) { $ map = $ this -> getMap ( ) ; $ dbValues = array_diff ( array_keys ( $ map ) , $ except ) ; return $ dbValues ; } | Returns list of the all registered database values |
238,730 | public function getAllowedHumanValues ( array $ except = [ ] ) { $ map = $ this -> getMap ( ) ; $ humanValues = array_diff ( array_values ( $ map ) , $ except ) ; return $ humanValues ; } | Returns list of the all registered humanized values |
238,731 | public function getMap ( ) { $ result = [ ] ; foreach ( $ this -> getConstants ( ) as $ dbName => $ dbValue ) { if ( 0 === strpos ( $ dbName , self :: PREFIX_DB ) ) { $ result [ $ dbValue ] = $ this -> getAppropriateConstValue ( self :: PREFIX_DB , $ dbName ) ; } } return $ result ; } | Returns map of the all registered values in the key = > value pairs . The key equal to database value and the value equal to humanized value . |
238,732 | public function getRandomDbValue ( array $ except = [ ] ) { $ values = $ this -> getAllowedDbValues ( $ except ) ; shuffle ( $ values ) ; return array_shift ( $ values ) ; } | Returns random database value |
238,733 | public function getRandomHumanValue ( array $ except = [ ] ) { $ values = $ this -> getAllowedHumanValues ( $ except ) ; shuffle ( $ values ) ; return array_shift ( $ values ) ; } | Returns random humanized value |
238,734 | protected function getAppropriateConstValue ( $ prefixFrom , $ constName ) { $ prefixTo = $ prefixFrom === self :: PREFIX_DB ? self :: PREFIX_HUMAN : self :: PREFIX_DB ; $ count = 1 ; $ constName = str_replace ( $ prefixFrom , $ prefixTo , $ constName , $ count ) ; return constant ( 'static::' . $ constName ) ; } | Returns appropriated pair value |
238,735 | private function convert ( $ value , $ prefixFrom ) { foreach ( $ this -> getConstants ( ) as $ constName => $ constValue ) { if ( 0 === strpos ( $ constName , $ prefixFrom ) && $ value === $ constValue ) { return $ this -> getAppropriateConstValue ( $ prefixFrom , $ constName ) ; } } throw new UndefinedMapValueExcepti... | Returns appropriated value by received origin value . Humanized value by received database value and vise versa . |
238,736 | private function getConstants ( ) { if ( empty ( $ this -> constants ) ) { try { $ reflection = new \ ReflectionClass ( $ this -> getClassName ( ) ) ; $ this -> constants = $ reflection -> getConstants ( ) ; } catch ( \ ReflectionException $ e ) { $ this -> constants = [ ] ; } } return $ this -> constants ; } | Returns list of the all available constants of the current class |
238,737 | public function getAuthorizeUrl ( array $ params = [ ] ) { $ result = $ this -> OAuthRequest ( self :: API_BASE . self :: REQUEST_PATH , $ params ) ; if ( $ result -> getCode ( ) == 200 ) { $ tokens = $ this -> parseResponse ( $ result -> getResponse ( ) ) ; return [ 'auth_url' => self :: API_BASE . $ this -> auth_meth... | Gets the authorization url . |
238,738 | public function loadRequest ( $ buffer ) { $ this -> requestAt = microtime ( true ) ; list ( $ this -> _rawHeader , $ this -> _rawBody ) = explode ( "\r\n\r\n" , $ buffer , 2 ) ; $ headers = explode ( "\r\n" , $ this -> _rawHeader , 2 ) ; list ( $ this -> method , $ this -> uri , $ this -> version ) = explode ( ' ' , $... | load reqeust buffer to this object |
238,739 | public static function getCheckDigit ( string $ number ) : int { if ( ! ctype_digit ( $ number ) ) { throw new \ InvalidArgumentException ( 'The number must be a string of digits' ) ; } $ checksum = self :: checksum ( $ number . '0' ) ; return ( $ checksum === 0 ) ? 0 : 10 - $ checksum ; } | Computes and returns the check digit of a number . |
238,740 | public static function isValid ( string $ number ) : bool { if ( ctype_digit ( $ number ) ) { return self :: checksum ( $ number ) === 0 ; } return false ; } | Checks that a number is valid . |
238,741 | private static function checksum ( string $ number ) : int { $ number = strrev ( $ number ) ; $ length = strlen ( $ number ) ; $ sum = 0 ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ value = $ number [ $ i ] * ( $ i % 2 + 1 ) ; $ sum += ( $ value >= 10 ? $ value - 9 : $ value ) ; } return $ sum % 10 ; } | Computes the checksum of a number . |
238,742 | public static function api_support ( ) { $ existing_classes = get_declared_classes ( ) ; foreach ( glob ( dirname ( dirname ( __FILE__ ) ) . '/services/*.class.php' ) as $ file ) { include $ file ; } $ with_sdk_classes = get_declared_classes ( ) ; $ new_classes = array_diff ( $ with_sdk_classes , $ existing_classes ) ;... | Gets information about the web service APIs that the SDK supports . |
238,743 | public function assertIsInstance ( $ class , $ instance , $ message = '%s and %s are not the same instance' , $ exception = 'Asserts' ) { $ is_instance = ( get_class ( $ class ) === $ instance ) ; if ( $ is_instance === false ) { $ this -> throwException ( $ exception , $ message , array ( get_class ( $ class ) , $ ins... | Verifies that the specified conditions are of the same instance . The assertion fails if they are not . |
238,744 | public function listenerHandle ( IEvent $ event ) { $ event -> post -> count_views ++ ; $ event -> post -> save ( ) ; var_dump ( $ event -> post -> count_views ) ; } | Update the post view count |
238,745 | public function hiddenInput ( $ options = [ ] ) { $ options = array_replace_recursive ( $ this -> inputOptions , $ options ) ; $ this -> adjustLabelFor ( $ options ) ; $ this -> parts [ '{label}' ] = false ; $ this -> parts [ '{input}' ] = Html :: activeHiddenInput ( $ this -> model , $ this -> attribute , $ options ) ... | override original method |
238,746 | public function getEventDescription ( ) { $ event = array ( 'type' => null , 'name' => null , 'args' => null , 'params' => null ) ; if ( is_string ( $ this -> value ) ) { $ event [ 'type' ] = $ this -> value ; } else { $ event [ 'type' ] = isset ( $ this -> value [ 'type' ] ) ? $ this -> value [ 'type' ] : null ; $ eve... | Retrieve event description |
238,747 | public function getImporters ( $ all = false ) { $ importers = [ ] ; foreach ( $ this -> importers as $ importer ) { if ( $ importer -> isEnabled ( ) || true === $ all ) { $ importers [ $ importer -> getKey ( ) ] = $ importer ; } } return $ importers ; } | Returns importers keyed by their internal key . |
238,748 | public function getImporter ( $ key ) { foreach ( $ this -> getImporters ( true ) as $ k => $ importer ) { if ( $ key === $ k ) { return $ importer ; } } throw new \ InvalidArgumentException ( sprintf ( 'Importer could not be found by key `%s`.' , $ key ) ) ; } | Retrieves an importer by key |
238,749 | public function getImporterKeys ( $ all = false ) { $ keys = [ ] ; if ( $ all ) { $ keys = $ this -> importerKeys ; } else { foreach ( $ this -> importerKeys as $ key => $ bit ) { if ( $ bit ) { $ keys [ ] = $ key ; } } } return $ keys ; } | Returns the stored enabled importers for this model . |
238,750 | public function getSegmentKeys ( $ all = false ) { $ keys = [ ] ; if ( $ all ) { $ keys = $ this -> segmentKeys ; } else { foreach ( $ this -> segmentKeys as $ key => $ bit ) { if ( $ bit ) { $ keys [ ] = $ key ; } } } return $ keys ; } | Returns the stored enabled segments for this model . |
238,751 | public function getSegment ( $ key ) { foreach ( $ this -> getImporters ( ) as $ importer ) { if ( $ importer -> hasSegment ( $ key ) ) { return $ importer -> getSegment ( $ key ) ; } } throw new \ InvalidArgumentException ( sprintf ( 'Segment could not be found by key `%s`.' , $ key ) ) ; } | Retrieves a segment by key |
238,752 | public function toggleImporter ( $ key ) { $ importer = $ this -> getImporter ( $ key ) ; $ importer -> toggle ( ) ; foreach ( $ importer -> getSegments ( ) as $ segment ) { if ( $ importer -> isEnabled ( ) ) { $ this -> addSegment ( $ segment ) ; } else { $ this -> removeSegment ( $ segment ) ; } } } | Toggles an importer and its segments |
238,753 | public function toggleSegment ( $ key ) { $ segment = $ this -> getSegment ( $ key ) ; if ( false === $ segment -> isEnabled ( ) ) { return $ segment -> enable ( ) ; } return $ segment -> disable ( ) ; } | Toggles a segment |
238,754 | public function getSegments ( $ all = false ) { if ( $ all ) { return $ this -> segments ; } $ segments = [ ] ; foreach ( $ this -> segments as $ segment ) { if ( $ segment -> isEnabled ( ) ) { $ segments [ ] = $ segment ; } } return $ segments ; } | Returns segments keyed by their internal key . |
238,755 | final protected function process ( \ SelectQueryInterface $ select , Query $ query ) { if ( $ query -> hasSortField ( ) ) { $ select -> orderBy ( $ query -> getSortField ( ) , Query :: SORT_DESC === $ query -> getSortOrder ( ) ? 'desc' : 'asc' ) ; } $ select -> orderBy ( 'u.uid' , Query :: SORT_DESC === $ query -> getS... | Implementors must set the users table with u as alias and call this method for the datasource to work correctly . |
238,756 | public function requestToken ( TokenRequest $ request ) { $ result = $ this -> request ( 'POST' , '/tokens' , [ 'card[number]' => $ request -> getCardNumber ( ) , 'card[exp_month]' => $ request -> getExpirationMonth ( ) , 'card[exp_year]' => $ request -> getExpirationYear ( ) , 'card[cvc]' => $ request -> getSecurityCo... | Returns a new token . |
238,757 | public function getToken ( $ id ) { $ result = $ this -> request ( 'GET' , '/tokens/' . $ id ) ; return $ this -> objectConverter -> convert ( $ result ) ; } | Returns the token by id . |
238,758 | public function getCharges ( $ limit = 10 , $ startingAfter = null , $ endingBefore = null ) { $ endpointUrl = '/charges?limit=' . $ limit ; if ( $ startingAfter ) { $ endpointUrl .= '&starting_after=' . $ startingAfter ; } if ( $ endingBefore ) { $ endpointUrl .= '&ending_before=' . $ endingBefore ; } $ result = $ thi... | Returns the charges . |
238,759 | public function getCharge ( $ id ) { $ result = $ this -> request ( 'GET' , '/charges/' . $ id ) ; return $ this -> objectConverter -> convert ( $ result ) ; } | Returns the charge by id . |
238,760 | public function charge ( ChargeRequest $ request ) { $ result = $ this -> request ( 'POST' , '/charges' , [ 'card' => ( string ) $ request -> getToken ( ) , 'amount' => $ request -> getAmount ( ) ? $ request -> getAmount ( ) -> getAmount ( ) : null , 'currency' => $ request -> getAmount ( ) ? $ request -> getAmount ( )... | Creates a new charge . |
238,761 | public function capture ( $ charge ) { $ result = $ this -> request ( 'POST' , '/charges/' . $ charge . '/capture' ) ; return $ this -> objectConverter -> convert ( $ result ) ; } | Captures the charge . |
238,762 | public function refund ( $ charge ) { $ result = $ this -> request ( 'POST' , '/charges/' . $ charge . '/refund' ) ; return $ this -> objectConverter -> convert ( $ result ) ; } | Refunds the charge . |
238,763 | public static function getPrefixSuffix ( $ expressionType = Expression :: EXPRESSION_TYPE_PLAIN ) { $ prefix = '' ; $ suffix = '' ; $ patternPrefix = '' ; $ patternSuffix = '' ; switch ( $ expressionType ) { case Expression :: EXPRESSION_TYPE_PLAIN : $ patternPrefix = '^' ; $ patternSuffix = '$' ; break ; case Expressi... | Get prefix and suffix |
238,764 | public function selector ( $ selector ) { if ( is_scalar ( $ selector ) ) { $ this -> selector = json_encode ( $ selector ) ; } else { $ this -> selector = Buffering \ Callback :: do ( $ selector ) ; } return $ this ; } | Keeps jquery selector |
238,765 | function getQueryExecutor ( ) { if ( ! $ this -> exec ) { $ this -> exec = new QueryExecutor ( $ this -> conn ) ; } return $ this -> exec ; } | Get the query executor |
238,766 | function getMetadataCache ( ) { if ( ! isset ( $ this -> metadatCache ) ) { $ this -> metadataCache = static :: $ defaultMetadataCache ? : new Table \ StaticCache ; } return $ this -> metadataCache ; } | Get the metadata cache |
238,767 | function getIdentity ( ) { if ( ! isset ( $ this -> identity ) ) { $ this -> identity = new Table \ Identity ( $ this ) ; } return $ this -> identity ; } | Get the primary key |
238,768 | function getRelations ( ) { if ( ! isset ( $ this -> relations ) ) { $ this -> relations = new Table \ Relations ( $ this ) ; } return $ this -> relations ; } | Get foreign key relations |
238,769 | function notify ( \ pq \ Gateway \ Row $ row = null , $ event = null , array & $ where = null ) { foreach ( $ this -> observers as $ observer ) { $ observer -> update ( $ this , $ row , $ event , $ where ) ; } } | Implements \ SplSubject |
238,770 | public function onResult ( \ pq \ Result $ result = null ) { if ( $ result && $ result -> status != \ pq \ Result :: TUPLES_OK ) { return $ result ; } $ rowset = $ this -> getRowsetPrototype ( ) ; if ( is_callable ( $ rowset ) ) { return $ rowset ( $ result ) ; } elseif ( $ rowset ) { return new $ rowset ( $ this , $ r... | Retreives the result of an executed query |
238,771 | function find ( array $ where = null , $ order = null , $ limit = 0 , $ offset = 0 , $ lock = null ) { $ query = $ this -> getQueryWriter ( ) -> reset ( ) ; $ query -> write ( "SELECT * FROM" , $ this -> conn -> quoteName ( $ this -> name ) ) ; if ( $ where ) { $ query -> write ( "WHERE" ) -> criteria ( $ where ) ; } i... | Find rows in the table |
238,772 | function of ( Row $ foreign , $ ref = null , $ order = null , $ limit = 0 , $ offset = 0 ) { if ( ! ( $ rel = $ this -> getRelation ( $ foreign -> getTable ( ) -> getName ( ) , $ ref ) ) ) { return $ this -> onResult ( null ) ; } $ where = array ( ) ; foreach ( $ rel as $ key => $ ref ) { $ where [ "$key=" ] = $ foreig... | Get the child rows of a row by foreign key |
238,773 | function by ( Row $ foreign , $ ref = null ) { if ( ! ( $ rel = $ foreign -> getTable ( ) -> getRelation ( $ this -> getName ( ) , $ ref ) ) ) { return $ this -> onResult ( null ) ; } $ where = array ( ) ; foreach ( $ rel as $ key => $ ref ) { $ where [ "$ref=" ] = $ foreign -> $ key ; } return $ this -> find ( $ where... | Get the parent rows of a row by foreign key |
238,774 | function with ( array $ relations , array $ where = null , $ order = null , $ limit = 0 , $ offset = 0 ) { $ qthis = $ this -> conn -> quoteName ( $ this -> getName ( ) ) ; $ query = $ this -> getQueryWriter ( ) -> reset ( ) ; $ query -> write ( "SELECT" , "$qthis.*" , "FROM" , $ qthis ) ; foreach ( $ relations as $ re... | Get rows dependent on other rows by foreign keys |
238,775 | function create ( array $ data = null , $ returning = "*" ) { $ query = $ this -> getQueryWriter ( ) -> reset ( ) ; $ query -> write ( "INSERT INTO" , $ this -> conn -> quoteName ( $ this -> name ) ) ; if ( $ data ) { $ first = true ; $ params = array ( ) ; foreach ( $ data as $ key => $ val ) { $ query -> write ( $ fi... | Insert a row into the table |
238,776 | function update ( array $ where , array $ data , $ returning = "*" ) { $ query = $ this -> getQueryWriter ( ) -> reset ( ) ; $ query -> write ( "UPDATE" , $ this -> conn -> quoteName ( $ this -> name ) ) ; $ first = true ; foreach ( $ data as $ key => $ val ) { $ query -> write ( $ first ? "SET" : "," , $ key , "=" , $... | Update rows in the table |
238,777 | function delete ( array $ where , $ returning = null ) { $ query = $ this -> getQueryWriter ( ) -> reset ( ) ; $ query -> write ( "DELETE FROM" , $ this -> conn -> quoteName ( $ this -> name ) ) ; $ query -> write ( "WHERE" ) -> criteria ( $ where ) ; if ( strlen ( $ returning ) ) { $ query -> write ( "RETURNING" , $ r... | Delete rows from the table |
238,778 | public function load ( $ data , $ dataType = 'json' ) { $ this -> _data = ( $ dataType != 'json' ) ? $ this -> dataToJson ( $ data ) : $ data ; } | loads the dataset and converts it to the correct format |
238,779 | public function draw ( $ div , array $ options = [ ] ) { $ output = '' ; if ( self :: $ _first ) { $ output .= $ this -> initChart ( ) ; } $ output .= '<script type="text/javascript">' . "\n" ; $ output .= 'google.setOnLoadCallback(drawChart' . self :: $ _count . ');' . "\n" ; $ output .= 'function drawChart' . self ::... | draws the chart |
238,780 | private function getColumns ( $ data ) { $ cols = [ ] ; foreach ( $ data [ 0 ] as $ key => $ value ) { if ( is_numeric ( $ key ) ) { if ( is_string ( $ data [ 1 ] [ $ key ] ) ) { $ cols [ ] = [ 'id' => '' , 'label' => $ value , 'type' => 'string' ] ; } else { $ cols [ ] = [ 'id' => '' , 'label' => $ value , 'type' => '... | substracts the column names from the first and second row in the dataset |
238,781 | private function dataToJson ( $ data ) { $ cols = $ this -> getColumns ( $ data ) ; $ rows = [ ] ; foreach ( $ data as $ key => $ row ) { if ( $ key != 0 || ! $ this -> _skipFirstRow ) { $ c = [ ] ; foreach ( $ row as $ v ) { $ c [ ] = [ 'v' => $ v ] ; } $ rows [ ] = [ 'c' => $ c ] ; } } return json_encode ( [ 'cols' =... | convert array data to json |
238,782 | protected function processResponse ( ResponseInterface $ response ) { if ( 200 !== $ response -> getStatusCode ( ) ) { throw new IcoBenchException ( sprintf ( 'IcoBench replied with non-success status (%s)' , $ response -> getStatusCode ( ) ) ) ; } $ data = json_decode ( $ response -> getBody ( ) , true ) ; if ( isset ... | Get data from response |
238,783 | public function getTotal ( $ user , $ type = '' , $ count = 'points' ) { $ em = $ this -> serviceLocator -> get ( 'playgroundflow_doctrine_em' ) ; if ( $ count == 'points' ) { $ aggregate = 'SUM(e.points)' ; } elseif ( $ count == 'count' ) { $ aggregate = 'COUNT(e.id)' ; } switch ( $ type ) { case 'game' : $ filter = a... | This function return count of events or total points by event category for one user |
238,784 | public function clear ( ) { if ( $ this -> files -> exists ( $ this -> destination ) ) { $ this -> files -> remove ( $ this -> destination ) ; } $ this -> files -> mkdir ( $ this -> destination ) ; } | Clear destination folder |
238,785 | public function build ( Route $ route , $ name , array $ parameters = [ ] ) { $ url = $ this -> app [ 'url_generator' ] -> generate ( $ name , $ parameters , UrlGeneratorInterface :: ABSOLUTE_URL ) ; $ request = Request :: create ( $ url , 'GET' , array_merge ( [ '_format' => $ route -> getFormat ( ) ] , $ parameters )... | Dump the given Route into a file |
238,786 | public function getBoundary ( ) : Geometry { $ event = new AccessorOpEvent ( $ this ) ; $ this -> fireOperationEvent ( AccessorOpEvent :: BOUNDARY_EVENT , $ event ) ; return $ event -> getResults ( ) ; } | Gets the closure of the combinatorial bound of this Geometry object |
238,787 | public function getEnvelope ( ) : Geometry { $ event = new AccessorOpEvent ( $ this ) ; $ this -> fireOperationEvent ( AccessorOpEvent :: ENVELOPE_EVENT , $ event ) ; return $ event -> getResults ( ) ; } | Gets the minimum bounding box for this Geometry as a Geometry . |
238,788 | public function asText ( bool $ extended = false ) : string { $ event = new OutputOpEvent ( $ this , [ 'extended' => $ extended ] ) ; $ this -> fireOperationEvent ( OutputOpEvent :: AS_TEXT_EVENT , $ event ) ; return $ event -> getResults ( ) ; } | Exports this Geometry object to a specific Well - known Text Representation . |
238,789 | public function asBinary ( bool $ extended = false , string $ endianness = 'NDR' , bool $ unpack = false ) : string { $ event = new OutputOpEvent ( $ this , [ 'extended' => $ extended , 'endianness' => $ endianness , 'unpack' => $ unpack ] ) ; $ this -> fireOperationEvent ( OutputOpEvent :: AS_BINARY_EVENT , $ event ) ... | Exports this Geometry object to a specific Well - known Binary Representation . |
238,790 | public function isSimple ( ) : bool { $ event = new AccessorOpEvent ( $ this ) ; $ this -> fireOperationEvent ( AccessorOpEvent :: IS_SIMPLE_EVENT , $ event ) ; return $ event -> getResults ( ) ; } | Indicates whether this Geometry object has no anomalous geometric points such as self intersection of self tangency . |
238,791 | public function convexHull ( ) : Geometry { $ event = new ProcessOpEvent ( $ this ) ; $ this -> fireOperationEvent ( ProcessOpEvent :: CONVEX_HULL_EVENT , $ event ) ; return $ event -> getResults ( ) ; } | Gets a Geometry that represents the convex hull of this Geometry . |
238,792 | public function getCentroid ( bool $ use_spheriod = false ) : Point { $ event = new AccessorOpEvent ( $ this , [ 'use_spheriod' => $ use_spheriod ] ) ; $ this -> fireOperationEvent ( AccessorOpEvent :: CENTROID_EVENT , $ event ) ; return $ event -> getResults ( ) ; } | The mathematical centroid for this Surface as a Point . The result is not guaranteed to be on this Surface . |
238,793 | public function authentication ( ) { $ response = \ Aperdia \ Clef :: authentication ( $ _GET [ 'code' ] ) ; if ( ! $ response ) { $ error = 'Error' ; } elseif ( isset ( $ response [ 'error' ] ) ) { $ error = $ response [ 'error' ] ; } elseif ( isset ( $ response [ 'success' ] ) ) { $ verif = Authentication :: wherepro... | Authentication with Clef account |
238,794 | public function logout ( ) { if ( isset ( $ _POST [ 'logout_token' ] ) ) { $ clef = \ Aperdia \ Clef :: logout ( $ _POST [ 'logout_token' ] ) ; if ( ! $ clef ) { $ auth = Authentication :: whereprovider ( "clef" ) -> whereprovider_uid ( $ clef ) -> first ( ) ; if ( ! empty ( $ auth ) ) { $ user = User :: find ( $ auth ... | Logout by WebHook |
238,795 | public function getWizard ( ManipulateWidgetEvent $ event ) { if ( $ event -> getModel ( ) -> getProviderName ( ) !== $ this -> metaModel -> getTableName ( ) || $ event -> getProperty ( ) -> getName ( ) !== $ this -> propertyName ) { return ; } $ propName = $ event -> getProperty ( ) -> getName ( ) ; $ model = $ event ... | Build the wizard string . |
238,796 | public function build ( string $ key , $ value , \ DateTimeInterface $ expire = null ) : Cookie { return new Cookie ( $ key , $ this -> encryptor -> encrypt ( $ value ) , $ expire , '/' , $ this -> domain , $ this -> secure ) ; } | Builds a new cookie |
238,797 | public function clearCache ( ) { if ( $ this -> connector -> getURL ( ) === null ) { return 'Cannot find site URL from configuration.' ; } $ url = $ this -> connector -> getURL ( ) . self :: VERSION . $ this -> connector -> getSiteID ( ) . '/cache-clear' ; $ params = [ ] ; $ response = $ this -> connector -> connecting... | Clear site cache . |
238,798 | public function createBackup ( $ label , $ components ) { if ( $ this -> connector -> getURL ( ) === null ) { return 'Cannot find site URL from configuration.' ; } $ url = $ this -> connector -> getURL ( ) . self :: VERSION . $ this -> connector -> getSiteID ( ) . '/backup' ; $ params = [ 'label' => $ label , 'componen... | Create backup for specific site in site factory . |
238,799 | public function deleteBackup ( $ backupId , $ callbackUrl , $ callbackMethod , $ callerData ) { if ( $ this -> connector -> getURL ( ) === null ) { return 'Cannot find site URL from configuration.' ; } $ url = $ this -> connector -> getURL ( ) . self :: VERSION . $ this -> connector -> getSiteID ( ) . '/backups/' . $ b... | Delete backup . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.