idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
36,000 | public function hydrate ( $ row ) { $ class = $ this -> _class ; $ ret = $ class :: fromArray ( $ this -> unmarshal ( $ row ) ) ; $ ret -> events ( ) -> trigger ( 'afterHydrate' , $ ret ) ; return $ ret ; } | Hydrates a database array into the domain object of the schema |
36,001 | public function marshal ( $ row ) { foreach ( $ this -> _props as $ key => $ prop ) { if ( isset ( $ row [ $ key ] ) ) { $ row [ $ key ] = $ prop -> type -> marshal ( $ row [ $ key ] ) ; } } return $ row ; } | Converts an array using each columns type object to database format |
36,002 | public function equals ( $ o1 , $ o2 ) { foreach ( $ this -> _props as $ key => $ prop ) { if ( ! $ prop -> type -> equals ( $ o1 -> get ( $ key ) , $ o2 -> get ( $ key ) ) ) return false ; } return true ; } | Check if two objects have equal values as determined by their types |
36,003 | public function diff ( $ o1 , $ o2 ) { $ diff = array ( ) ; foreach ( $ this -> _props as $ key => $ prop ) { if ( ! $ prop -> type -> equals ( $ o1 -> get ( $ key ) , $ o2 -> get ( $ key ) ) ) $ diff [ ] = $ key ; } return $ diff ; } | Returns the keys that differ from the second object to the first by their types |
36,004 | public function getter ( $ attr ) { if ( isset ( $ this -> _getters [ $ attr ] ) ) { return $ this -> _getters [ $ attr ] ; } elseif ( isset ( $ this -> _props [ $ attr ] ) ) { return $ this -> _props [ $ attr ] -> getter ( $ attr ) ; } elseif ( isset ( $ this -> _rels [ $ attr ] ) ) { return $ this -> _rels [ $ attr ] -> getter ( $ attr ) ; } throw new Exception ( "No getter available for $attr" ) ; } | Return a closure for getting an attribute from a domain object |
36,005 | public function setter ( $ attr ) { if ( isset ( $ this -> _setters [ $ attr ] ) ) { return $ this -> _setters [ $ attr ] ; } elseif ( isset ( $ this -> _props [ $ attr ] ) ) { return $ this -> _props [ $ attr ] -> setter ( $ attr ) ; } elseif ( isset ( $ this -> _rels [ $ attr ] ) ) { return $ this -> _rels [ $ attr ] -> setter ( $ attr ) ; } throw new Exception ( "No setter available for $attr" ) ; } | Return a closure for setting an attribute on a domain object |
36,006 | public function hasAttribute ( $ attr ) { if ( isset ( $ this -> _setters [ $ attr ] ) ) { return true ; } elseif ( isset ( $ this -> _props [ $ attr ] ) ) { return true ; } elseif ( isset ( $ this -> _rels [ $ attr ] ) ) { return true ; } return false ; } | Check if attribute is available on a domain object |
36,007 | public function hydrate ( $ row ) { $ hydrated = $ this -> _schema -> hydrate ( $ row ) ; foreach ( $ this -> _includes as $ prop => $ includer ) { $ hydrated -> override ( $ prop , function ( $ prop , $ obj ) use ( $ includer ) { return $ includer -> get ( $ obj , $ prop ) ; } ) ; } return $ hydrated ; } | Hydrates a row to a DomainObject |
36,008 | public function one ( ) { $ object = $ this -> offsetGet ( 0 ) ; $ count = $ this -> count ( ) ; if ( $ count === 0 ) { throw new NotFoundException ( "Expected 1 element, found 0" ) ; } elseif ( $ count > 1 ) { throw new ConstraintException ( "Expected only 1 element, found $count" ) ; } return $ object ; } | Return one and one only object from a collection |
36,009 | public function count ( ) { if ( ! isset ( $ this -> _count ) ) $ this -> _count = $ this -> _iterator -> count ( ) ; return $ this -> _count ; } | Counts the number or results in the query |
36,010 | public function column ( $ field ) { $ query = clone $ this -> _queryForWrite ( ) ; return $ query -> select ( $ field ) -> execute ( ) -> column ( $ field ) ; } | Reduces a collection down to a single column |
36,011 | public function orCreate ( $ args ) { $ query = clone $ this -> _queryForWrite ( ) ; if ( ! $ query -> count ( ) ) $ this -> _schema -> newInstance ( func_get_args ( ) ) -> save ( ) ; return $ this ; } | Creates the passed params as a domain object if there are no results in the collection . |
36,012 | public function save ( $ callback ) { foreach ( $ this as $ object ) { call_user_func ( $ callback , $ object ) ; if ( $ object -> changes ( ) ) $ object -> save ( ) ; } return $ this ; } | Applies a callback to all objects in Collection saves them if the object has changed |
36,013 | public function includes ( $ rels ) { foreach ( Relationship :: normalizeMap ( $ rels ) as $ alias => $ nested ) { $ this -> _includes [ $ alias ] = new Relationships \ Includer ( $ this -> _query , $ this -> _schema -> relationship ( $ alias ) , $ nested ) ; } return $ this ; } | Eager load relationships to avoid the N + 1 problem |
36,014 | public function aggregate ( $ function , $ fields = null ) { $ query = clone $ this -> _query ; return $ query -> select ( sprintf ( '%s(%s)' , $ function , $ fields ) ) -> execute ( ) -> scalar ( ) ; } | helpers for common aggregate functions |
36,015 | public function transform ( Order $ order ) { foreach ( $ order -> meta ( ) as $ key => $ total ) { $ payload [ $ key ] = $ this -> converter -> convert ( $ total ) ; } $ payload [ 'products' ] = [ ] ; foreach ( $ order -> products ( ) as $ product ) { $ payload [ 'products' ] [ ] = array_map ( function ( $ value ) { return $ this -> converter -> convert ( $ value ) ; } , $ product ) ; } return json_encode ( $ payload ) ; } | Transform the Order |
36,016 | protected function setModifiers ( $ modifiers ) { if ( is_array ( $ modifiers ) === true ) { $ modifiersArray = $ modifiers ; $ modifiers = Modifiers :: MODIFIER_NONE ; foreach ( $ modifiersArray as $ modifier ) { $ modifiers |= $ modifier ; } } $ this -> modifiers = $ modifiers ; } | Set modifiers for the member . |
36,017 | public function orderFormAction ( ) { $ locale = $ this -> getUser ( ) -> getLocale ( ) ; return $ this -> render ( 'SuluSalesOrderBundle:Template:order.form.html.twig' , [ 'systemUser' => $ this -> getSystemUserArray ( ) , 'systemUserId' => $ this -> getUser ( ) -> getContact ( ) -> getId ( ) , 'termsOfPayment' => $ this -> getTermsArray ( self :: $ termsOfPaymentEntityName ) , 'termsOfDelivery' => $ this -> getTermsArray ( self :: $ termsOfDeliveryEntityName ) , 'orderStatus' => $ this -> getOrderStatus ( ) , 'currencies' => $ this -> getCurrencies ( $ locale ) , 'customerId' => Account :: TYPE_CUSTOMER , 'taxClasses' => $ this -> getTaxClasses ( $ locale ) , 'units' => $ this -> getProductUnits ( $ locale ) , 'customerTypes' => $ this -> getCustomerTypesManager ( ) -> retrieveAllAsArray ( $ locale ) , 'customerTypeDefault' => $ this -> getCustomerTypesManager ( ) -> retrieveDefault ( $ locale ) ] ) ; } | Returns Template for list . |
36,018 | public function getSystemUserArray ( ) { $ repo = $ this -> get ( 'sulu_security.user_repository' ) ; $ users = $ repo -> findUserBySystem ( $ this -> container -> getParameter ( 'sulu_security.system' ) ) ; $ contacts = [ ] ; foreach ( $ users as $ user ) { $ contact = $ user -> getContact ( ) ; $ contacts [ ] = [ 'id' => $ contact -> getId ( ) , 'fullName' => $ contact -> getFullName ( ) ] ; } return $ contacts ; } | Returns all sulu system users . |
36,019 | public function deleteFieldData ( VersionInfo $ versionInfo , array $ fieldIds , array $ context ) { $ this -> gateway -> deleteFieldData ( $ versionInfo , $ fieldIds ) ; return true ; } | Deletes field data . |
36,020 | protected function registerAdminTheme ( ) { $ adminTheme = config ( 'themes.backend' , 'default' ) ; $ basePath = config ( 'themes.path.backend' , base_path ( 'themes/backend' ) ) ; $ this -> loadViewsFrom ( $ basePath . DIRECTORY_SEPARATOR . $ adminTheme , 'admin' ) ; } | Register admin view namespace . |
36,021 | public function setName ( $ name ) { if ( $ this -> isNameValid ( $ name ) !== true ) { throw new InvalidArgumentException ( 'The name is not valid.' ) ; } $ this -> name = $ name ; return $ this ; } | Set the name of the entity . |
36,022 | public static function extractShortNameFromFullyQualifiedName ( $ name ) { if ( ( $ pos = strrpos ( $ name , '\\' ) ) !== false ) { return substr ( $ name , $ pos + 1 ) ; } else { return $ name ; } } | Extract the short name from the a fully qualified name . |
36,023 | public function api ( $ method , $ path , $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false , $ internal = false ) { return $ this -> _callApi ( $ method , $ path , $ parameters , $ multipart , $ appOnlyAuth , $ internal ) ; } | The Twitter Api Call . |
36,024 | public function getLabel ( ) { $ label = $ this -> label ; if ( is_null ( $ label ) ) { $ label = $ this -> getName ( ) ; } return $ label ; } | Gets the label of this group |
36,025 | public function setName ( $ name ) { if ( ! is_string ( $ name ) ) { throw new \ InvalidArgumentException ( 'The name must be a string' ) ; } Arr :: set ( $ this -> attributes , 'name' , $ name ) ; return $ this ; } | Sets the name of this input |
36,026 | public function siblings ( ) { if ( $ p = $ this -> parent ) { return $ p -> children -> filter ( function ( $ item ) { return $ item -> id !== $ this -> id ; } ) ; } return null ; } | Get page siblings |
36,027 | public function getPrimaryField ( $ item , $ config = null ) { if ( $ config === null ) { $ config = config ( 'crudapi' ) ; } if ( ! isset ( $ config [ 'models' ] [ 'fields' ] [ 'default' ] ) ) { $ defaultField = 'name' ; } else { $ defaultField = $ config [ 'models' ] [ 'fields' ] [ 'default' ] ; } $ class = get_class ( $ item ) ; $ stripped_class = str_replace ( $ this -> crudApi -> namespace , '' , $ class ) ; if ( substr ( $ stripped_class , 0 , 1 ) == '\\' ) { $ stripped_class = substr ( $ stripped_class , 1 ) ; } $ primaryFields = $ config [ 'models' ] [ 'fields' ] [ 'primary' ] ; if ( array_key_exists ( $ stripped_class , $ primaryFields ) ) { return $ primaryFields [ $ stripped_class ] ; } else { return $ defaultField ; } } | Retrieve the models primary field for display purposes . |
36,028 | public function displayPrimaryField ( $ item , $ config = null ) { $ field = $ this -> getPrimaryField ( $ item , $ config ) ; return $ item -> $ field ; } | Display the primary field . |
36,029 | public function formCreate ( $ fields ) { $ output = '' ; foreach ( $ fields as $ f ) { $ ucF = ucfirst ( $ f ) ; $ input_attr = [ 'class' => 'form-control' , 'id' => 'createItem' . $ f , 'name' => $ f , ] ; $ label = $ this -> humanReadableField ( $ ucF ) ; $ output .= '<fieldset class="form-group">' ; $ output .= '<label for="' . $ input_attr [ 'id' ] . '">' . $ label . '</label>' ; if ( $ this -> isIdField ( $ f ) ) { $ input_attr [ 'type' ] = 'select' ; $ output .= '<select ' ; foreach ( $ input_attr as $ attr => $ value ) { $ output .= "{$attr}='{$value}'" ; } $ relation = $ this -> crudApi -> getRelatedModel ( $ f ) ; $ output .= '>' ; $ output .= $ this -> crudApi -> getRelatedOptions ( $ relation ) ; $ output .= '</select>' ; } else { $ input_attr [ 'type' ] = 'text' ; $ output .= '<input ' ; foreach ( $ input_attr as $ attr => $ value ) { $ output .= "{$attr}='{$value}'" ; } $ output .= '>' ; } $ output .= '</fieldset>' ; } return $ output ; } | Render fields into appropriate format for an item creation form . |
36,030 | public function tableHeadings ( $ fields ) { $ output = '' ; foreach ( $ fields as $ f ) { $ field = $ this -> humanReadableField ( $ f ) ; $ output .= '<th>' . $ field . '</th>' ; } return $ output ; } | Return fields as table headings . |
36,031 | public function tableContent ( $ fields , $ instance ) { $ output = '' ; foreach ( $ fields as $ f ) { if ( $ this -> isIdField ( $ f ) ) { $ related = $ this -> getRelatedField ( $ f ) ; $ relation = $ instance -> $ related ; $ field = $ this -> getPrimaryField ( $ relation ) ; if ( strpos ( $ field , ',' ) ) { $ subfields = explode ( ',' , $ field ) ; $ display = '' ; foreach ( $ subfields as $ sf ) { $ display .= $ relation -> $ sf . ' ' ; } } else { $ display = $ relation -> $ field ; } $ output .= '<td>' . $ display . '</td>' ; } else { $ output .= '<td>' . $ instance -> $ f . '</td>' ; } } return $ output ; } | Output the instances fields into table content format . |
36,032 | private function getRotatedCharacter ( $ character , $ rotationAmount ) { $ alphabetSize = $ this -> getAlphabetSize ( ) ; $ positionInAlphabet = mb_stripos ( self :: ALPHABET , $ character ) ; if ( false === $ positionInAlphabet ) { $ rotatedCharacter = $ character ; } else { $ newCharacterOffset = ( ( $ positionInAlphabet + $ rotationAmount + $ alphabetSize ) % $ alphabetSize ) - $ positionInAlphabet ; $ rotatedCharacter = \ chr ( \ ord ( $ character ) + $ newCharacterOffset ) ; } return $ rotatedCharacter ; } | Get rotated character . |
36,033 | private function getValidRotationAmount ( $ rotationAmount ) { $ rotationAmount = ( int ) $ rotationAmount ; $ alphabetSize = $ this -> getAlphabetSize ( ) ; if ( $ rotationAmount < 0 ) { $ rotationAmount += ( int ) ceil ( - 1 * $ rotationAmount / $ alphabetSize ) * $ alphabetSize ; } return $ rotationAmount ; } | Get valid rotation amount . |
36,034 | static public function update ( $ id , array $ attrs ) { if ( is_array ( $ id ) ) { foreach ( $ id as $ k => $ i ) { static :: update ( $ i , $ attrs [ $ k ] ) ; } } else { $ object = static :: find ( $ id ) ; $ object -> updateAttributes ( $ attrs ) ; return $ object ; } } | Finds model by id and updates it . |
36,035 | static public function exists ( $ params ) { $ query = self :: none ( ) ; if ( ctype_digit ( ( string ) $ params ) ) { $ query -> where ( [ 'id' => $ params ] ) ; } else { if ( is_array ( $ params ) ) $ query -> where ( 'id IN (?)' , $ params ) ; else $ query -> where ( 'id IN (?)' , func_get_args ( ) ) ; } return $ query -> exists ( ) ; } | Searches if record exists by id . |
36,036 | static private function _create_model ( array $ data ) { self :: $ preventInit = true ; self :: $ skipDefaultAttributes = true ; $ model = new static ( ) ; $ model -> attributes = $ data ; if ( ! static :: table ( ) -> primaryKey ( ) ) { $ model -> storedAttributes = $ data ; } $ model -> isNewRecord = false ; $ model -> _register ( ) ; $ model -> init ( ) ; return $ model ; } | Creates and returns a non - empty model . This function is useful to centralize the creation of non - empty models since isNewRecord must set to null by passing non_empty . |
36,037 | public function updateAttribute ( $ attrName , $ value ) { $ this -> setAttribute ( $ attrName , $ value ) ; return $ this -> save ( [ 'skip_validation' => true , 'action' => 'update' ] ) ; } | Update single attribute . Sets a new value for the attribute and saves the record . Validations are skipped but callbacks are still ran . |
36,038 | protected function _get_stored_data ( ) { if ( ! ( $ prim_key = static :: table ( ) -> primaryKey ( ) ) && ! $ this -> storedAttributes ) { throw new Exception \ RuntimeException ( "Can't find data without primary key nor storedAttributes" ) ; } $ query = static :: none ( ) ; if ( $ prim_key ) { $ query -> where ( '`' . $ prim_key . '` = ?' , $ this -> $ prim_key ) ; } else { $ model = new static ( ) ; $ cols_names = static :: table ( ) -> columnNames ( ) ; foreach ( $ this -> storedAttributes as $ name => $ value ) { if ( in_array ( $ name , $ cols_names ) ) { $ model -> attributes [ $ name ] = $ value ; } } if ( ! $ model -> attributes ) throw new Exception \ RuntimeException ( "Model rebuilt from storedAttributes failed" ) ; else return $ model ; } $ current = $ query -> first ( ) ; if ( ! $ current ) throw new Exception \ RuntimeException ( "Row not found in database (searched with storedAttributes)" ) ; else return $ current ; } | Returns model s current data in the database or using storedAttributes . |
36,039 | protected function allCallbacks ( ) { if ( Rails :: env ( ) == 'production' ) { return Rails :: cache ( ) -> fetch ( 'rails.models.' . get_called_class ( ) . '.callbacks' , function ( ) { return array_merge_recursive ( $ this -> callbacks ( ) , $ this -> pluggedCallbacks ( ) ) ; } ) ; } else { return array_merge_recursive ( $ this -> callbacks ( ) , $ this -> pluggedCallbacks ( ) ) ; } } | Merges model s callbacks and plugged callbacks . If under production environment the callbacks will be cached . |
36,040 | private function pluggedCallbacks ( ) { $ callbacks = [ ] ; foreach ( self :: getReflection ( ) -> getMethods ( ) as $ method ) { $ methodName = $ method -> getName ( ) ; if ( strpos ( $ methodName , 'Callbacks' ) === strlen ( $ methodName ) - 9 && strpos ( $ method -> getDeclaringClass ( ) -> getName ( ) , 'Rails' ) !== 0 ) { $ callbacks = array_merge ( $ callbacks , $ this -> $ methodName ( ) ) ; } } return $ callbacks ; } | Any method that ends with Callbacks can return an array of callbacks . This is useful for traits that require to add some callbacks so they don t have to be manually called by the class implementing the trait . |
36,041 | private function _check_time_column ( $ column ) { if ( ! static :: table ( ) -> columnExists ( $ column ) ) return false ; $ type = static :: table ( ) -> columnType ( $ column ) ; if ( $ type == 'datetime' || $ type == 'timestamp' ) $ time = date ( 'Y-m-d H:i:s' ) ; elseif ( $ type == 'year' ) $ time = date ( 'Y' ) ; elseif ( $ type == 'date' ) $ time = date ( 'Y-m-d' ) ; elseif ( $ type == 'time' ) $ time = date ( 'H:i:s' ) ; else return false ; $ this -> attributes [ $ column ] = $ time ; return true ; } | Check time column |
36,042 | public function allEditable ( ) { $ editable = [ ] ; foreach ( $ this as $ key => $ value ) { if ( $ this -> cache [ $ key ] ) { $ editable [ $ key ] = $ value ; } } return $ editable ; } | Returns all the options that are editable . |
36,043 | public function setOrderAddress ( $ orderAddress , $ addressData , $ contact = null , $ account = null ) { $ contactData = $ this -> getContactData ( $ addressData , $ contact ) ; if ( $ contactData ) { $ orderAddress -> setFirstName ( $ contactData [ 'firstName' ] ) ; $ orderAddress -> setLastName ( $ contactData [ 'lastName' ] ) ; if ( isset ( $ contactData [ 'title' ] ) ) { $ orderAddress -> setTitle ( $ contactData [ 'title' ] ) ; } if ( isset ( $ contactData [ 'salutation' ] ) ) { $ orderAddress -> setSalutation ( $ contactData [ 'salutation' ] ) ; } if ( isset ( $ contactData [ 'formOfAddress' ] ) ) { $ orderAddress -> setFormOfAddress ( $ contactData [ 'formOfAddress' ] ) ; } } $ orderAddress -> setAccountName ( null ) ; $ orderAddress -> setUid ( null ) ; if ( $ account ) { $ orderAddress -> setAccountName ( $ account -> getName ( ) ) ; $ orderAddress -> setUid ( $ account -> getUid ( ) ) ; } $ this -> setAddressDataForOrder ( $ orderAddress , $ addressData ) ; } | Sets an order address based on given data |
36,044 | public function mergeContactIntoAddressData ( array & $ addressData , ContactInterface $ contact ) { $ addressData [ 'firstName' ] = $ contact -> getFirstName ( ) ; $ addressData [ 'lastName' ] = $ contact -> getLastName ( ) ; $ addressData [ 'fullName' ] = $ contact -> getFullName ( ) ; $ addressData [ 'salutation' ] = $ contact -> getSalutation ( ) ; $ addressData [ 'formOfAddress' ] = $ contact -> getFormOfAddress ( ) ; if ( $ contact -> getTitle ( ) !== null ) { $ addressData [ 'title' ] = $ contact -> getTitle ( ) -> getTitle ( ) ; } } | Sets contact data to address data . |
36,045 | private function setAddressDataForOrder ( & $ orderAddress , $ addressData ) { $ orderAddress -> setStreet ( $ this -> getProperty ( $ addressData , 'street' , '' ) ) ; $ orderAddress -> setNumber ( $ this -> getProperty ( $ addressData , 'number' , '' ) ) ; $ orderAddress -> setAddition ( $ this -> getProperty ( $ addressData , 'addition' , '' ) ) ; $ orderAddress -> setCity ( $ this -> getProperty ( $ addressData , 'city' , '' ) ) ; $ orderAddress -> setZip ( $ this -> getProperty ( $ addressData , 'zip' , '' ) ) ; $ orderAddress -> setState ( $ this -> getProperty ( $ addressData , 'state' , '' ) ) ; $ countryName = $ this -> getProperty ( $ addressData , 'country' , '' ) ; if ( is_array ( $ countryName ) ) { $ countryName = '' ; if ( isset ( $ countryName [ 'name' ] ) ) { $ countryName = $ countryName [ 'name' ] ; } } $ orderAddress -> setCountry ( $ countryName ) ; $ orderAddress -> setEmail ( $ this -> getProperty ( $ addressData , 'email' , '' ) ) ; $ orderAddress -> setPhone ( $ this -> getProperty ( $ addressData , 'phone' , '' ) ) ; $ orderAddress -> setNote ( $ this -> getProperty ( $ addressData , 'note' , '' ) ) ; $ orderAddress -> setPostboxCity ( $ this -> getProperty ( $ addressData , 'postboxCity' , '' ) ) ; $ orderAddress -> setPostboxPostcode ( $ this -> getProperty ( $ addressData , 'postboxPostcode' , '' ) ) ; $ orderAddress -> setPostboxNumber ( $ this -> getProperty ( $ addressData , 'postboxNumber' , '' ) ) ; $ address = null ; if ( $ this -> getProperty ( $ addressData , 'address' ) ) { $ address = $ this -> getProperty ( $ addressData , 'address' ) ; } elseif ( $ this -> getProperty ( $ addressData , 'contactAddress' ) ) { $ address = $ this -> getProperty ( $ addressData , 'contactAddress' ) ; } if ( $ address ) { $ this -> getAndSetOrderAddressByContactAddressId ( $ address , null , null , $ orderAddress ) ; } } | Copies address data to order address . |
36,046 | public function getContactData ( $ addressData , ContactInterface $ contact = null ) { $ result = [ ] ; if ( $ contact ) { $ this -> mergeContactIntoAddressData ( $ result , $ contact ) ; } elseif ( $ addressData && isset ( $ addressData [ 'firstName' ] ) && isset ( $ addressData [ 'lastName' ] ) ) { $ result [ 'firstName' ] = $ addressData [ 'firstName' ] ; $ result [ 'lastName' ] = $ addressData [ 'lastName' ] ; $ result [ 'fullName' ] = $ result [ 'firstName' ] . ' ' . $ result [ 'lastName' ] ; if ( isset ( $ addressData [ 'title' ] ) ) { $ result [ 'title' ] = $ addressData [ 'title' ] ; } if ( isset ( $ addressData [ 'salutation' ] ) ) { $ result [ 'salutation' ] = $ addressData [ 'salutation' ] ; } if ( isset ( $ addressData [ 'formOfAddress' ] ) ) { $ result [ 'formOfAddress' ] = $ addressData [ 'formOfAddress' ] ; } } else { throw new MissingAttributeException ( 'firstName, lastName or contact' ) ; } return $ result ; } | Returns contact data as an array . Either by provided address or contact . |
36,047 | public function use ( $ theme , $ frontend = true ) { $ key = $ frontend ? 'frontend' : 'backend' ; $ theme = $ theme ? : config ( 'themes.' . $ key , 'default' ) ; $ basePath = config ( 'themes.path.' . $ key , base_path ( 'themes/' . $ key ) ) ; $ this -> removeBasePath ( ) ; $ this -> setBasePath ( $ basePath . DIRECTORY_SEPARATOR . $ theme ) ; config ( [ 'themes.' . $ key => $ theme ] ) ; } | Use the given theme as the current theme . |
36,048 | public function setBasePath ( $ path ) { $ this -> basePath = $ path ; array_unshift ( $ this -> paths , $ this -> basePath ) ; } | Set file view finder base path . |
36,049 | protected function getAuthForLogin ( ) { if ( $ this -> hasRsaKey ( ) ) { return $ this -> loadRsaKey ( $ this -> auth ) ; } elseif ( isset ( $ this -> auth [ 'password' ] ) ) { return $ this -> auth [ 'password' ] ; } throw new \ InvalidArgumentException ( 'Password / key is required.' ) ; } | Get the authentication object for login . |
36,050 | public function getConnection ( ) { if ( $ this -> connection ) return $ this -> connection ; return $ this -> connection = new Net_SFTP ( $ this -> host , $ this -> port ) ; } | Get the underlying Net_SFTP connection . |
36,051 | public static function prefetchByLevel ( array $ instances , PrefetchInterface $ prefetcher , Prefetch $ lookup , $ level ) : array { $ additionaLookups = [ ] ; $ resp = $ prefetcher -> getPrefetchQueryset ( $ instances , $ lookup -> getCurrentQueryset ( $ level ) ) ; list ( $ relQs , $ valOnRelatedCallable , $ valOnInstanceCallable , $ isMany , $ cachename ) = $ resp ; $ relatedObjects = $ relQs -> getResults ( ) ; $ relMap = [ ] ; foreach ( $ relatedObjects as $ relatedObject ) { $ relAttrVal = $ valOnRelatedCallable ( $ relatedObject ) ; $ relMap [ $ relAttrVal ] [ ] = $ relatedObject ; } list ( $ toAttr , $ hasAsAttr ) = $ lookup -> getCurrentToAttr ( $ level ) ; foreach ( $ instances as $ instance ) { $ instanceVal = $ valOnInstanceCallable ( $ instance ) ; $ vals = ArrayHelper :: getValue ( $ relMap , $ instanceVal , [ ] ) ; if ( ! $ isMany ) { $ val = $ vals ? $ vals [ 0 ] : null ; if ( $ hasAsAttr ) { $ instance -> { $ toAttr } = $ val ; } else { $ instance -> _valueCache [ $ cachename ] = $ val ; } } else { if ( $ hasAsAttr ) { $ instance -> { $ toAttr } = $ vals ; } else { $ manger = $ instance -> { $ toAttr } ; $ qs = $ manger -> getQueryset ( ) ; $ qs -> _prefetchRelatedDone = true ; $ qs -> _resultsCache = $ vals ; $ instance -> _prefetchedObjectCaches [ $ cachename ] = $ qs ; } } } return [ $ relatedObjects , $ additionaLookups ] ; } | Perform the actual fetching of related objects by level . |
36,052 | public function getCurrentToAttr ( $ level ) { $ lookupNames = StringHelper :: split ( BaseLookup :: $ lookupPattern , $ this -> prefetchTo ) ; $ toAttr = $ lookupNames [ $ level ] ; $ hasAsAttr = $ this -> toAttr && $ level === count ( $ lookupNames ) - 1 ; return [ $ toAttr , $ hasAsAttr ] ; } | This is the attribute to which the values will be placed . |
36,053 | public static function normalizePrefetchLookup ( $ lookups , $ prefix = null ) : array { $ results = [ ] ; foreach ( $ lookups as $ lookup ) { if ( ! $ lookup instanceof Prefetch ) { $ lookup = new Prefetch ( $ lookup ) ; } if ( $ prefix ) { $ lookup -> addPrefix ( $ prefix ) ; } $ results [ ] = $ lookup ; } return $ results ; } | Ensures all prefetch looks are of the same form i . e . instance of Prefetch . |
36,054 | protected function createBaseMigration ( ) { $ name = 'create_password_reminders_table' ; $ path = $ this -> flyphp [ 'path' ] . '/database/migrations' ; return $ this -> flyphp [ 'migration.creator' ] -> create ( $ name , $ path ) ; } | Create a base migration file for the reminders . |
36,055 | protected function getMigrationStub ( ) { $ stub = $ this -> files -> get ( __DIR__ . '/stubs/reminders.stub' ) ; return str_replace ( 'password_reminders' , $ this -> getTable ( ) , $ stub ) ; } | Get the contents of the reminder migration stub . |
36,056 | public function getRelatedField ( ) { $ field = $ this -> toModel -> getMeta ( ) -> getField ( $ this -> fieldName ) ; if ( ! $ field -> concrete ) { throw new FieldDoesNotExist ( sprintf ( "No related field named '%s'" , $ this -> fieldName ) ) ; } return $ field ; } | Returns the Field in the toModel object to which this relationship is tied . |
36,057 | public static function next ( ) { $ queuedProcess = eZPersistentObject :: fetchObjectList ( eZPerfLoggerContentPublishingProcess :: definition ( ) , null , array ( 'status' => ezpContentPublishingProcess :: STATUS_PENDING ) , array ( 'created' => 'desc' ) , array ( 'offset' => 0 , 'length' => 1 ) ) ; if ( count ( $ queuedProcess ) == 0 ) return false ; else { $ db = eZDB :: instance ( ) ; $ processing = $ db -> arrayQuery ( "SELECT count(*) AS other" . "FROM ezpublishingqueueprocesses p, ezcontentobject_version v " . "WHERE p.ezcontentobject_version_id = v.id AND p.status = 1 AND v.contentobject_id IN ( " . "SELECT contentobject_id FROM ezcontentobject_version v2 WHERE id = " . $ queuedProcess [ 0 ] -> attribute ( 'ezcontentobject_version_id' ) . " )" ) ; if ( $ processing [ 0 ] [ 'other' ] ) { return false ; } return $ queuedProcess [ 0 ] ; } } | Reimplemented so that - we give back a different type of item to the queue processor - we only allow 1 concurrent publication per - object at a time |
36,058 | public function ConditionalQuery ( $ check , $ then , $ else ) { if ( $ check ( ) ) return $ then ( ) ; $ tran = $ this -> Begin ( ) ; if ( $ check ( ) ) return $ tran -> Rollback ( ) ; $ ret = $ else ( ) ; $ tran -> Commit ( ) ; return $ ret ; $ this -> ConditionalQuery ( function ( ) { return db :: Query ( "SELECT count(*) FROM table WHERE id=1" ) [ 'count' ] ; } , function ( ) { return db :: Query ( "UPDATE table SET acc=acc+1 WHERE id=1" ) ; } , function ( ) { return db :: Query ( "INSERT INTO table(id) VALUES (1)" ) ; } ) ; } | Dig into transaction if required |
36,059 | public static function start ( $ path , Finder $ finder = null , Filesystem $ files = null ) { $ finder = $ finder ? : new Finder ; $ files = $ files ? : new Filesystem ; $ autoloads = $ finder -> in ( $ path ) -> files ( ) -> name ( 'autoload.php' ) -> depth ( '<= 3' ) -> followLinks ( ) ; foreach ( $ autoloads as $ file ) { $ files -> requireOnce ( $ file -> getRealPath ( ) ) ; } } | Load the workbench vendor auto - load files . |
36,060 | protected function createMessage ( $ body ) { $ message = new models \ DbMessage ( ) ; $ message -> setAttributes ( [ 'queue_id' => $ this -> id , 'timeout' => $ this -> timeout , 'sender_id' => Yii :: $ app -> has ( 'user' ) ? Yii :: $ app -> user -> getId ( ) : null , 'status' => Message :: AVAILABLE , 'body' => $ body , ] , false ) ; return $ this -> formatMessage ( $ message ) ; } | Creates an instance of DbMessage model . The passed message body may be modified |
36,061 | protected function receiveInternal ( $ subscriber_id = null , $ limit = - 1 , $ mode = self :: GET_RESERVE ) { $ primaryKey = models \ DbMessage :: primaryKey ( ) ; $ trx = models \ DbMessage :: getDb ( ) -> transaction !== null ? null : models \ DbMessage :: getDb ( ) -> beginTransaction ( ) ; $ messages = models \ DbMessage :: find ( ) -> withQueue ( $ this -> id ) -> withSubscriber ( $ subscriber_id ) -> available ( $ this -> timeout ) -> limit ( $ limit ) -> indexBy ( $ primaryKey [ 0 ] ) -> all ( ) ; if ( ! empty ( $ messages ) ) { $ now = new \ DateTime ( 'now' , new \ DateTimezone ( 'UTC' ) ) ; if ( $ mode === self :: GET_DELETE ) { $ attributes = [ 'status' => Message :: DELETED , 'deleted_on' => $ now -> format ( 'Y-m-d H:i:s' ) ] ; } elseif ( $ mode === self :: GET_RESERVE ) { $ attributes = [ 'status' => Message :: RESERVED , 'reserved_on' => $ now -> format ( 'Y-m-d H:i:s' ) ] ; } if ( isset ( $ attributes ) ) { models \ DbMessage :: updateAll ( $ attributes , [ 'in' , models \ DbMessage :: primaryKey ( ) , array_keys ( $ messages ) ] ) ; } } if ( $ trx !== null ) { $ trx -> commit ( ) ; } return models \ DbMessage :: createMessages ( $ messages ) ; } | Perform message extraction . |
36,062 | public function releaseTimedout ( ) { $ trx = models \ DbMessage :: getDb ( ) -> transaction !== null ? null : models \ DbMessage :: getDb ( ) -> beginTransaction ( ) ; $ primaryKey = models \ DbMessage :: primaryKey ( ) ; $ message_ids = models \ DbMessage :: find ( ) -> withQueue ( $ this -> id ) -> timedout ( $ this -> timeout ) -> select ( $ primaryKey ) -> asArray ( ) -> all ( ) ; models \ DbMessage :: updateAll ( [ 'status' => Message :: AVAILABLE ] , [ 'in' , $ primaryKey , $ message_ids ] ) ; if ( $ trx !== null ) { $ trx -> commit ( ) ; } return $ message_ids ; } | Releases timed - out messages . |
36,063 | public function removeDeleted ( ) { $ trx = models \ DbMessage :: getDb ( ) -> transaction !== null ? null : models \ DbMessage :: getDb ( ) -> beginTransaction ( ) ; $ primaryKey = models \ DbMessage :: primaryKey ( ) ; $ message_ids = models \ DbMessage :: find ( ) -> withQueue ( $ this -> id ) -> deleted ( ) -> select ( $ primaryKey ) -> asArray ( ) -> all ( ) ; models \ DbMessage :: deleteAll ( [ 'in' , $ primaryKey , $ message_ids ] ) ; if ( $ trx !== null ) { $ trx -> commit ( ) ; } return $ message_ids ; } | Removes deleted messages from the storage . |
36,064 | public function findPages ( ) : array { $ foundPages = [ ] ; $ root = $ this -> getPagesPath ( ) ; if ( $ root ) { $ root .= '/' ; foreach ( $ this -> generatePageFiles ( $ root ) as $ file ) { $ slug = $ this -> getSlug ( $ root , $ file ) ; $ foundPages [ $ slug ] = ( object ) [ 'info' => $ file , 'content' => $ this -> buildContentFunction ( $ file ) , 'slug' => $ slug , 'depth' => count ( explode ( '/' , $ slug ) ) , ] ; } } return $ foundPages ; } | Produces array of page objects from discovered pages indexed by slug |
36,065 | public function setRange ( $ min , $ max ) { $ this -> setMin ( $ min ) ; $ this -> setMax ( $ max ) ; return $ this ; } | Defines the values of both the min and max attributes as a range . |
36,066 | public static function getRelatedMapper ( $ klassInfo , $ select , ConnectionInterface $ connection ) { $ mappers = [ ] ; $ relatedKlassInfo = ArrayHelper :: getValue ( $ klassInfo , 'related_klass_infos' , [ ] ) ; foreach ( $ relatedKlassInfo as $ klassInfo ) { $ mappers [ ] = new RelatedMappers ( $ klassInfo , $ select , $ connection ) ; } return $ mappers ; } | Creates mappers to use for related model . |
36,067 | public function getData ( $ assoc = false , $ depth = 512 , $ options = 0 ) { return json_decode ( $ this -> data , $ assoc , $ depth , $ options ) ; } | Get the json_decoded data from the response |
36,068 | protected function createRules ( $ field , $ rules ) { $ rule = str_replace ( [ '(' , ')' , ';' ] , [ ':' , '' , ',' ] , implode ( '|' , $ rules ) ) ; if ( $ this -> scaffold ) { $ rule = 'required' ; } return "\t\t\t'{$field}' => '" . $ rule . "'," . PHP_EOL ; } | Create a rule . |
36,069 | public static function getDatabaseConfig ( $ database ) { $ cached = self :: $ cache [ $ database ] ?? null ; if ( $ cached !== null ) { return $ cached ; } if ( self :: $ config === null ) { throw new \ BadMethodCallException ( 'Config was not loaded' ) ; } if ( ! array_key_exists ( $ database , self :: $ config [ 'databases' ] ) ) { throw new \ LogicException ( "Unknown database '$database'" ) ; } $ data = self :: $ config [ 'databases' ] [ $ database ] ; if ( is_string ( $ data ) ) { $ data = [ 'database_name' => $ data ] ; } $ server = $ data [ 'server' ] ?? 'default' ; $ servers = self :: $ config [ 'servers' ] ?? [ ] ; if ( array_key_exists ( $ server , $ servers ) ) { unset ( $ data [ 'server' ] ) ; $ data = array_merge ( $ servers [ $ server ] , $ data ) ; } self :: $ cache [ $ database ] = $ data ; return $ data ; } | Returns data for Medoo connect to a Database |
36,070 | public static function getInstance ( $ database , $ anonymous = false ) { if ( $ anonymous || ! array_key_exists ( $ database , self :: $ instances ) ) { $ instance = new Medoo ( self :: getDatabaseConfig ( $ database ) ) ; if ( $ anonymous ) { return $ instance ; } self :: $ instances [ $ database ] = $ instance ; } return self :: $ instances [ $ database ] ; } | Returns a Medoo instance connected to a specific database |
36,071 | protected function getButtonsSpecification ( ) { $ specification = array ( ) ; foreach ( $ this -> buttons as $ button ) { $ specification [ $ button -> getName ( ) ] = $ button -> getButtonSpecification ( ) ; } return $ specification ; } | Returns the specification of the buttons for the AjaxView |
36,072 | public function setFromName ( $ fieldName ) { if ( empty ( $ this -> name ) ) { $ this -> name = $ fieldName ; } $ this -> attrName = $ this -> getAttrName ( ) ; $ this -> concrete = false === empty ( $ this -> getColumnName ( ) ) ; if ( empty ( $ this -> verboseName ) ) { $ this -> verboseName = ucwords ( str_replace ( '_' , ' ' , $ this -> name ) ) ; } } | set some values using the field name passed in . called in contributeToClass . |
36,073 | public function convertToPHPValue ( $ value ) { try { return Type :: getType ( $ this -> dbType ( $ this -> getDbConnection ( ) ) ) -> convertToPHPValue ( $ value , $ this -> getDbConnection ( ) -> getDatabasePlatform ( ) ) ; } catch ( \ Exception $ exception ) { throw new ValidationError ( $ exception -> getMessage ( ) , 'invalid' ) ; } } | Convert the value to a php value . |
36,074 | public function getChoices ( $ opts = [ ] ) { $ include_blank_dash = ( array_key_exists ( 'include_blank' , $ opts ) ) ? false == $ opts [ 'include_blank' ] : true ; $ first_choice = [ ] ; if ( $ include_blank_dash ) { $ first_choice = self :: BLANK_CHOICE_DASH ; } if ( ! empty ( $ this -> choices ) ) { return array_merge ( $ first_choice , $ this -> choices ) ; } } | Returns choices with a default blank choices included for use as SelectField choices for this field . |
36,075 | public function convertToDatabaseValue ( $ value , $ connection , $ prepared = false ) { if ( false === $ prepared ) { $ value = $ this -> prepareValue ( $ value ) ; } return Type :: getType ( $ this -> dbType ( $ connection ) ) -> convertToDatabaseValue ( $ value , $ connection -> getDatabasePlatform ( ) ) ; } | Converts value to a backend - specific value . this will be used also when creating lookups . |
36,076 | public function folders ( $ folders ) { foreach ( ( array ) $ folders as $ folderPath ) { if ( ! $ this -> file -> exists ( $ folderPath ) ) { $ this -> file -> makeDirectory ( $ folderPath ) ; } } } | Create any number of folders |
36,077 | public function index ( ) { $ contents = Content :: with ( 'author' ) -> latestBy ( Content :: CREATED_AT ) -> page ( ) -> paginate ( ) ; set_meta ( 'title' , 'List of Pages' ) ; return view ( 'orchestra/story::admin.index' , [ 'contents' => $ contents , 'create' => Gate :: allows ( 'create' , Content :: newPageInstance ( ) ) , 'type' => 'page' , ] ) ; } | List all the pages . |
36,078 | public function create ( ) { set_meta ( 'title' , 'Write a Page' ) ; $ content = Content :: newPageInstance ( ) ; $ content -> setAttribute ( 'format' , $ this -> editorFormat ) ; $ this -> authorize ( 'create' , $ content ) ; return view ( 'orchestra/story::admin.editor' , [ 'content' => $ content , 'url' => handles ( 'orchestra::storycms/pages' ) , 'method' => 'POST' , ] ) ; } | Write a page . |
36,079 | public function edit ( $ id = null ) { set_meta ( 'title' , 'Write a Page' ) ; $ content = Content :: page ( ) -> where ( 'id' , $ id ) -> firstOrFail ( ) ; $ this -> authorize ( 'update' , $ content ) ; return view ( 'orchestra/story::admin.editor' , [ 'content' => $ content , 'url' => handles ( "orchestra::storycms/pages/{$content->getAttribute('id')}" ) , 'method' => 'PUT' , ] ) ; } | Edit a page . |
36,080 | public function setAttributes ( $ values ) { if ( ! is_array ( $ values ) ) { return ; } foreach ( $ values as $ name => $ value ) { $ this -> $ name = $ value ; } } | Sets the properties values in a massive way . |
36,081 | public function pushLog ( $ key , $ val = '' , $ length = null ) { if ( ! ( is_string ( $ key ) || is_numeric ( $ key ) ) ) { return ; } $ key = urlencode ( $ key ) ; if ( is_array ( $ val ) ) { if ( $ length ) { $ val = $ this -> substrLog ( $ val , $ length ) ; } $ this -> _pushlogs [ ] = "$key=" . json_encode ( $ val ) ; } elseif ( is_bool ( $ val ) ) { $ this -> _pushlogs [ ] = "$key=" . var_export ( $ val , true ) ; } elseif ( is_string ( $ val ) || is_numeric ( $ val ) ) { if ( $ length && is_string ( $ val ) && strlen ( $ val ) > $ length ) { $ val = $ this -> substrLog ( $ val , $ length ) ; } $ this -> _pushlogs [ ] = "$key=" . urlencode ( $ val ) ; } elseif ( is_null ( $ val ) ) { $ this -> _pushlogs [ ] = "$key=" ; } } | for info level log only |
36,082 | public function getUserCapabilities ( string $ userId ) : array { if ( empty ( $ this -> userCapabilities ) ) { $ this -> userCapabilities = Utils :: fetchUserCapabilities ( $ userId ) ; } return $ this -> userCapabilities ; } | Method that retrieves specified user s capabilities |
36,083 | private function getArrayableItems ( $ items ) { if ( $ items instanceof Collection ) { $ items = $ items -> all ( ) ; } elseif ( $ items instanceof ArrayableInterface ) { $ items = $ items -> toArray ( ) ; } return $ items ; } | Results array of items from Collection or ArrayableInterface . |
36,084 | public function getOpCodes ( ) { if ( ! empty ( $ this -> opCodes ) ) { return $ this -> opCodes ; } $ i = 0 ; $ j = 0 ; $ this -> opCodes = array ( ) ; $ blocks = $ this -> getMatchingBlocks ( ) ; foreach ( $ blocks as $ block ) { list ( $ ai , $ bj , $ size ) = $ block ; $ tag = '' ; if ( $ i < $ ai && $ j < $ bj ) { $ tag = 'replace' ; } else if ( $ i < $ ai ) { $ tag = 'delete' ; } else if ( $ j < $ bj ) { $ tag = 'insert' ; } if ( $ tag ) { $ this -> opCodes [ ] = array ( $ tag , $ i , $ ai , $ j , $ bj ) ; } $ i = $ ai + $ size ; $ j = $ bj + $ size ; if ( $ size ) { $ this -> opCodes [ ] = array ( 'equal' , $ ai , $ i , $ bj , $ j ) ; } } return $ this -> opCodes ; } | Return a list of all of the opcodes for the differences between the two strings . |
36,085 | public function getById ( int $ value ) { $ cacheResult = $ this -> cacheGet ( $ value ) ; if ( ! empty ( $ cacheResult ) ) { return $ cacheResult ; } $ rtn = $ this -> where ( 'id' , $ value ) -> first ( ) ; $ this -> cacheSet ( $ value , $ rtn ) ; return $ rtn ; } | Get a Log object by Id . |
36,086 | public function info ( $ url ) { $ url = 'http://' . $ this -> ip . '/' . ltrim ( $ url , '/' ) ; $ options = [ CURLOPT_URL => $ url , CURLOPT_PORT => $ this -> port , CURLOPT_RETURNTRANSFER => true , CURLOPT_VERBOSE => WS :: config ( ) -> get ( 'debug' , false ) ] ; $ ch = curl_init ( ) ; curl_setopt_array ( $ ch , $ options ) ; $ response = curl_exec ( $ ch ) ; return $ this -> formatResponse ( $ response ) ; } | Fetches device information |
36,087 | protected function formatResponse ( $ response ) { if ( static :: FORMAT_ARRAY === $ this -> output ) { $ response = static :: xmlToArray ( $ response ) ; } else if ( static :: FORMAT_JSON === $ this -> output ) { $ response = static :: xmlToArray ( $ response ) ; $ response = json_encode ( $ response , JSON_UNESCAPED_SLASHES ) ; } return $ response ; } | Formats XML response to array or json |
36,088 | public function ingestAllFeeds ( ) { $ feeds = $ this -> getFeeds ( ) ; if ( count ( $ feeds ) > 0 ) { $ updated = array ( ) ; foreach ( $ feeds as $ feed ) { $ updated [ ] = $ this -> updateFeed ( $ feed , false ) ; } $ this -> liftEmbargo ( ) ; return count ( $ updated ) ; } else { return 0 ; } } | Ingest content of all feeds |
36,089 | private function getLanguage ( $ language , $ defaultLanguage = null ) { $ languageEntity = null ; if ( $ language !== null && $ language !== '' ) { if ( $ language instanceof \ Newscoop \ Entity \ Language ) { $ languageEntity = $ language ; } elseif ( strpos ( $ language , '-' ) !== false && count ( $ language ) === 2 ) { $ languageEntity = $ this -> em -> getRepository ( '\Newscoop\Entity\Language' ) -> findByCode ( $ language ) ; } else { try { $ languageEntity = $ this -> em -> getRepository ( '\Newscoop\Entity\Language' ) -> findByRFC3066bis ( $ language ) ; } catch ( Exception $ e ) { $ languageEntity = null ; $ this -> logger -> info ( __METHOD__ . ': Language for entry could not be found. Reverting to default language.' ) ; } } } if ( ! in_array ( $ languageEntity , $ this -> allowedLanguages ) ) { $ languageEntity = $ defaultLanguage ; } return $ languageEntity ; } | Gets a language based on the language parameter . Accepts multiple |
36,090 | public function order ( $ domainName , \ Transip \ Model \ WebhostingPackage $ webhostingPackage ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ webhostingPackage ) , array ( '__method' => 'order' ) ) ) -> order ( $ domainName , $ webhostingPackage ) ; } | Order webhosting for a domain name |
36,091 | public function upgrade ( $ domainName , $ newWebhostingPackage ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ newWebhostingPackage ) , array ( '__method' => 'upgrade' ) ) ) -> upgrade ( $ domainName , $ newWebhostingPackage ) ; } | Upgrade the webhosting of a domain name to a new webhosting package to a given new package . |
36,092 | public function setFtpPassword ( $ domainName , $ newPassword ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ newPassword ) , array ( '__method' => 'setFtpPassword' ) ) ) -> setFtpPassword ( $ domainName , $ newPassword ) ; } | Set a new FTP password for a webhosting package |
36,093 | public function createCronjob ( $ domainName , \ Transip \ Model \ Cronjob $ cronjob ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ cronjob ) , array ( '__method' => 'createCronjob' ) ) ) -> createCronjob ( $ domainName , $ cronjob ) ; } | Create a cronjob |
36,094 | public function createMailBox ( $ domainName , \ Transip \ Model \ MailBox $ mailBox ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ mailBox ) , array ( '__method' => 'createMailBox' ) ) ) -> createMailBox ( $ domainName , $ mailBox ) ; } | Creates a MailBox for a webhosting package . The address field of the MailBox object must be unique . |
36,095 | public function setMailBoxPassword ( $ domainName , \ Transip \ Model \ MailBox $ mailBox , $ newPassword ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ mailBox , $ newPassword ) , array ( '__method' => 'setMailBoxPassword' ) ) ) -> setMailBoxPassword ( $ domainName , $ mailBox , $ newPassword ) ; } | Sets a new password for a MailBox |
36,096 | public function modifyMailForward ( $ domainName , \ Transip \ Model \ MailForward $ mailForward ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ mailForward ) , array ( '__method' => 'modifyMailForward' ) ) ) -> modifyMailForward ( $ domainName , $ mailForward ) ; } | Changes an active MailForward object |
36,097 | public function createDatabase ( $ domainName , \ Transip \ Model \ Db $ db ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ db ) , array ( '__method' => 'createDatabase' ) ) ) -> createDatabase ( $ domainName , $ db ) ; } | Creates a new database |
36,098 | public function setDatabasePassword ( $ domainName , \ Transip \ Model \ Db $ db , $ newPassword ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ db , $ newPassword ) , array ( '__method' => 'setDatabasePassword' ) ) ) -> setDatabasePassword ( $ domainName , $ db , $ newPassword ) ; } | Sets A database password for a Db |
36,099 | public function deleteDatabase ( $ domainName , $ db ) { return $ this -> getSoapClient ( array_merge ( array ( $ domainName , $ db ) , array ( '__method' => 'deleteDatabase' ) ) ) -> deleteDatabase ( $ domainName , $ db ) ; } | Deletes a Db object |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.