idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
49,200
public function buildTabUserWhat ( $ bid , $ rid , $ tab = false ) { $ this -> initialize ( ) ; $ sbas_id = phrasea :: sbasFromBas ( $ this -> app , $ bid ) ; try { $ record = new record_adapter ( $ this -> app , $ sbas_id , $ rid ) ; } catch ( \ Exception_Record_AdapterNotFound $ e ) { return $ this -> report ; } $ th...
Return basic information about a record
49,201
public function getListeBase ( $ separator ) { $ all_coll = $ this -> getAllColl ( ) ; $ liste = '' ; foreach ( $ all_coll as $ sbas => $ info ) { $ liste .= phrasea :: sbas_labels ( $ sbas , $ this -> app ) . ' ' . $ separator . ' ' ; } return $ liste ; }
La liste des base authorisee sous forme de string
49,202
public function createDatabase ( Request $ request ) { $ dbName = $ request -> request -> get ( 'new_dbname' , '' ) ; $ databoxService = $ this -> app [ 'databox.service' ] ; $ dataTemplate = $ request -> request -> get ( 'new_data_template' ) ; try { $ connectionSettings = $ this -> buildSettingsFromRequest ( $ reques...
Create a new databox
49,203
public function databaseMount ( Request $ request ) { $ dbName = trim ( $ request -> request -> get ( 'new_dbname' , '' ) ) ; $ databoxService = $ this -> app [ 'databox.service' ] ; try { $ connectionSettings = $ this -> buildSettingsFromRequest ( $ request ) ; \ phrasea :: clear_sbas_params ( $ this -> app ) ; $ data...
Mount a databox
49,204
public function mergeWith ( Field $ other ) { if ( ( $ name = $ other -> getName ( ) ) !== $ this -> name ) { throw new MergeException ( sprintf ( "Fields have different names (%s vs %s)" , $ this -> name , $ name ) ) ; } if ( ( $ type = $ other -> getType ( ) ) !== $ this -> type ) { throw new MergeException ( sprintf...
Merge with another field returning the new instance
49,205
public function tokenAction ( Request $ request ) { $ config = $ this -> app [ 'conf' ] ; if ( ! $ request -> isSecure ( ) && $ config -> get ( [ 'main' , 'api_require_ssl' ] , true ) == true ) { throw new HttpException ( 400 , 'This route requires the use of the https scheme: ' . $ config -> get ( [ 'main' , 'api_requ...
TOKEN ENDPOINT Token endpoint - used to exchange an authorization grant for an access token .
49,206
protected function computeQuantity ( ) { $ n = 0 ; foreach ( $ this -> container -> getDataboxes ( ) as $ databox ) { $ n += $ databox -> get_record_amount ( ) ; } return $ n ; }
Return the total quantity of records to process
49,207
public function find ( Token $ token ) { $ infos = $ token -> getIdentity ( ) ; if ( $ infos -> has ( Identity :: PROPERTY_EMAIL ) ) { return $ this -> repository -> findByEmail ( $ infos -> get ( Identity :: PROPERTY_EMAIL ) ) ; } return null ; }
Find a matching user given a token
49,208
public function denyTermsOfUse ( $ sbas_id ) { try { $ databox = $ this -> findDataboxById ( ( int ) $ sbas_id ) ; $ this -> getAclForUser ( ) -> revoke_access_from_bases ( array_keys ( $ this -> getAclForUser ( ) -> get_granted_base ( [ ] , [ $ databox -> get_sbas_id ( ) ] ) ) ) ; $ this -> getAclForUser ( ) -> revoke...
Deny database terms of use
49,209
public function displayTermsOfUse ( Request $ request ) { $ toDisplay = $ request -> query -> get ( 'to_display' , [ ] ) ; $ data = [ ] ; foreach ( $ this -> getApplicationBox ( ) -> get_databoxes ( ) as $ databox ) { if ( count ( $ toDisplay ) > 0 && ! in_array ( $ databox -> get_sbas_id ( ) , $ toDisplay ) ) { contin...
Display database terms of use
49,210
public function checkSessionActivity ( GetResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; if ( $ request -> request -> has ( 'oauth_token' ) || $ request -> query -> has ( 'oauth_token' ) || $ request -> query -> has ( 'LOG' ) || null === $ moduleId = $ this -> getModuleId ( $ request -> getPathInfo (...
log real human activity on application to keep session alive
49,211
public function create ( Application $ app , $ id , $ email = null , array $ templates = [ ] ) { if ( ! $ this -> enabled ) { throw new RuntimeException ( 'Account creator is disabled' ) ; } $ login = $ id ; $ n = 1 ; if ( null !== $ email && null !== $ app [ 'repo.users' ] -> findByEmail ( $ email ) ) { throw new Inva...
Creates an account
49,212
public function getCollectionsUsedByPrivateFields ( ) { $ map = [ ] ; foreach ( $ this -> private as $ name => $ field ) { $ map [ $ name ] = $ field -> getDependantCollections ( ) ; } return $ map ; }
Returns an array of collections indexed by field name .
49,213
public function getNotifications ( Request $ request ) { if ( ! $ request -> isXmlHttpRequest ( ) ) { $ this -> app -> abort ( 400 ) ; } $ ret = [ 'status' => 'unknown' , 'message' => '' , 'notifications' => false , 'changed' => [ ] ] ; $ authenticator = $ this -> getAuthenticator ( ) ; if ( $ authenticator -> isAuthen...
Check things to notify
49,214
public function deleteSession ( Request $ request , $ id ) { $ session = $ this -> getSessionRepository ( ) -> find ( $ id ) ; if ( null === $ session ) { $ this -> app -> abort ( 404 , 'Unknown session' ) ; } if ( null === $ session -> getUser ( ) ) { $ this -> app -> abort ( 403 , 'Unauthorized' ) ; } if ( $ session ...
Deletes identified session
49,215
public function sendConfirmMail ( Request $ request ) { if ( null === $ usrId = $ request -> query -> get ( 'usr_id' ) ) { $ this -> app -> abort ( 400 , 'Missing usr_id parameter.' ) ; } $ user = $ this -> getUserRepository ( ) -> find ( ( int ) $ usrId ) ; if ( ! $ user instanceof User ) { $ this -> app -> addFlash (...
Send a confirmation mail after register
49,216
public function registerConfirm ( Request $ request ) { if ( null === $ code = $ request -> query -> get ( 'code' ) ) { $ this -> app -> addFlash ( 'error' , $ this -> app -> trans ( 'Invalid unlock link.' ) ) ; return $ this -> app -> redirectPath ( 'homepage' ) ; } if ( null === $ token = $ this -> getTokenRepository...
Validation of email address
49,217
public function forgotPassword ( Request $ request ) { $ form = $ this -> app -> form ( new PhraseaForgotPasswordForm ( ) ) ; $ service = $ this -> getRecoveryService ( ) ; try { if ( 'POST' === $ request -> getMethod ( ) ) { $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ data = $ form -> getD...
Submit the new password
49,218
public function displayRegisterForm ( Request $ request ) { if ( ! $ this -> getRegistrationManager ( ) -> isRegistrationEnabled ( ) ) { $ this -> app -> abort ( 404 , 'Registration is disabled' ) ; } if ( 0 < count ( $ this -> getAuthenticationProviders ( ) ) ) { return $ this -> render ( 'login/register.html.twig' , ...
Get the register form
49,219
public function logout ( Request $ request ) { $ this -> dispatch ( PhraseaEvents :: LOGOUT , new LogoutEvent ( $ this -> app ) ) ; $ this -> getAuthenticator ( ) -> closeAccount ( ) ; $ this -> app -> addFlash ( 'info' , $ this -> app -> trans ( 'Vous etes maintenant deconnecte. A bientot.' ) ) ; $ response = $ this -...
Logout from Phraseanet
49,220
public function login ( Request $ request ) { try { $ this -> getApplicationBox ( ) -> get_connection ( ) ; } catch ( \ Exception $ e ) { $ this -> app -> addFlash ( 'error' , $ this -> app -> trans ( 'login::erreur: No available connection - Please contact sys-admin' ) ) ; } $ feeds = $ this -> getFeedRepository ( ) -...
Login into Phraseanet
49,221
public function authenticate ( Request $ request ) { $ form = $ this -> app -> form ( new PhraseaAuthenticationForm ( $ this -> app ) ) ; $ redirector = function ( array $ params = [ ] ) { return $ this -> app -> redirectPath ( 'homepage' , $ params ) ; } ; try { return $ this -> doAuthentication ( $ request , $ form ,...
Authenticate to phraseanet
49,222
public function postAuthProcess ( Request $ request , User $ user ) { $ date = new \ DateTime ( '+' . ( int ) $ this -> getConf ( ) -> get ( [ 'registry' , 'actions' , 'validation-reminder-days' ] ) . ' days' ) ; $ manager = $ this -> getEntityManager ( ) ; foreach ( $ this -> getValidationParticipantRepository ( ) -> ...
move this in an event
49,223
private function getGrantedCollections ( \ ACL $ acl ) { $ collections = [ ] ; foreach ( $ acl -> get_granted_sbas ( ) as $ databox ) { $ sbasId = $ databox -> get_sbas_id ( ) ; foreach ( $ acl -> get_granted_base ( [ \ ACL :: CANADDRECORD ] , [ $ sbasId ] ) as $ collection ) { $ databox = $ collection -> get_databox (...
Get current user s granted collections where he can upload
49,224
private function getUploadMaxFileSize ( ) { $ postMaxSize = trim ( ini_get ( 'post_max_size' ) ) ; if ( '' === $ postMaxSize ) { $ postMaxSize = PHP_INT_MAX ; } switch ( strtolower ( substr ( $ postMaxSize , - 1 ) ) ) { case 'g' : $ postMaxSize *= 1024 ; case 'm' : $ postMaxSize *= 1024 ; case 'k' : $ postMaxSize *= 10...
Get POST max file size
49,225
protected function generateRecordMissingSubdefs ( \ record_adapter $ record ) { $ wanted_subdefs = $ record -> get_missing_subdefs ( ) ; if ( ! empty ( $ wanted_subdefs ) ) { $ this -> getSubdefGenerator ( ) -> generateSubdefs ( $ record , $ wanted_subdefs ) ; foreach ( $ wanted_subdefs as $ subdef ) { $ this -> contai...
Generate subdef generation and return number of subdef
49,226
private function sanitizeUsrTable ( $ em ) { $ rs = $ em -> createNativeQuery ( "SHOW FIELDS FROM usr WHERE Field = 'usr_login';" , ( new ResultSetMapping ( ) ) -> addScalarResult ( 'Type' , 'Type' ) ) -> getSingleResult ( ) ; if ( 0 !== strpos ( strtolower ( $ rs [ 'Type' ] ) , 'varbinary' ) ) { return ; } $ rs = $ em...
Fix character set in usr table .
49,227
private function emptyTables ( EntityManager $ em ) { $ meta = $ em -> getClassMetadata ( 'Alchemy\Phrasea\Model\Entities\User' ) ; $ connection = $ em -> getConnection ( ) ; $ dbPlatform = $ connection -> getDatabasePlatform ( ) ; if ( $ connection -> getSchemaManager ( ) -> tablesExist ( [ $ meta -> getTableName ( ) ...
Empty User & migration table .
49,228
private function updateUsers ( EntityManager $ em ) { $ em -> getConnection ( ) -> executeUpdate ( 'INSERT INTO Users ( id, activity, address, admin, can_change_ftp_profil, can_change_profil, city, company,...
Sets user entity from usr table .
49,229
private function updateTemplateOwner ( EntityManager $ em ) { $ em -> getConnection ( ) -> executeUpdate ( ' UPDATE Users INNER JOIN usr ON ( usr.usr_id = Users.id AND usr.model_of IS NOT NULL AND usr.model_of>0 ) ...
Sets model from usr table .
49,230
public function displayMultiExport ( Request $ request ) { $ download = new \ set_export ( $ this -> app , $ request -> request -> get ( 'lst' , '' ) , $ request -> request -> get ( 'ssel' , '' ) , $ request -> request -> get ( 'story' ) ) ; return new Response ( $ this -> render ( 'common/dialog_export.html.twig' , [ ...
Display form to export documents
49,231
public function getAllQuestionByUser ( $ value , $ what ) { $ result = [ ] ; $ sqlBuilder = new module_report_sql ( $ this -> app , $ this ) ; $ filter = $ sqlBuilder -> getFilters ( ) -> getReportFilter ( ) ; $ params = array_merge ( [ ':main_value' => $ value ] , $ filter [ 'params' ] ) ; $ sql = " SELECT ...
Get all questions by user
49,232
public function getTopQuestion ( $ tab = false , $ no_answer = false ) { $ this -> report [ 'value' ] = [ ] ; $ this -> report [ 'value2' ] = [ ] ; $ this -> setDateField ( 'log_search.date' ) ; $ sqlBuilder = new module_report_sql ( $ this -> app , $ this ) ; $ filter = $ sqlBuilder -> getFilters ( ) -> getReportFilte...
get the most asked question
49,233
public static function createFromUser ( Application $ app , User $ user , array $ restrictions = [ ] ) { $ feedRepository = $ app [ 'repo.feeds' ] ; $ feeds = $ feedRepository -> filterUserAccessibleByIds ( $ app -> getAclForUser ( $ user ) , $ restrictions ) ; $ token = $ app [ 'repo.aggregate-tokens' ] -> findOneBy (...
Creates an aggregate from all the feeds available to a given user .
49,234
public static function create ( Application $ app , array $ feed_ids ) { $ feeds = $ app [ 'repo.feeds' ] -> findByIds ( $ feed_ids ) ; return new static ( $ app , $ feeds ) ; }
Creates an aggregate from given Feed id array .
49,235
public function getCountTotalEntries ( ) { if ( $ this -> feeds -> isEmpty ( ) ) { return 0 ; } $ feedEntryRepository = $ this -> em -> getRepository ( 'Phraseanet:FeedEntry' ) ; return $ feedEntryRepository -> countByFeeds ( $ this -> feeds -> getKeys ( ) ) ; }
Returns the total number of entries from all the feeds .
49,236
public function renewUrl ( Request $ request ) { $ records = RecordsRequest :: fromRequest ( $ this -> app , $ request , ! ! $ request -> request -> get ( 'renew_children_url' ) ) ; $ renewed = [ ] ; foreach ( $ records as $ record ) { $ renewed [ $ record -> getId ( ) ] = ( string ) $ record -> get_preview ( ) -> rene...
Renew url list of records
49,237
public function get ( $ props , $ default = null ) { return \ igorw \ get_in ( $ this -> conf -> getConfig ( ) , $ this -> arrayize ( $ props ) , $ default ) ; }
Gets the value given one or more properties
49,238
public function set ( $ props , $ value ) { $ this -> conf -> setConfig ( \ igorw \ assoc_in ( $ this -> conf -> getConfig ( ) , $ this -> arrayize ( $ props ) , $ value ) ) ; return $ value ; }
Set a value to a property
49,239
public function merge ( $ props , array $ value ) { $ conf = $ this -> conf -> getConfig ( ) ; $ ret = $ this -> doMerge ( $ conf , $ this -> arrayize ( $ props ) , $ value ) ; $ this -> conf -> setConfig ( $ conf ) ; return $ ret ; }
Merges a value to the current property value
49,240
private function ab_fix_Sessions ( ) { $ ouputTable = new Table ( $ this -> output ) ; $ title = sprintf ( "fixing table \"%s.%s\"" , $ this -> appBox -> get_dbname ( ) , "Sessions" ) ; $ ouputTable -> setHeaders ( [ new TableCell ( $ title , [ 'colspan' => 2 ] ) ] ) ; $ site = $ this -> getContainer ( ) [ 'conf' ] -> ...
fix AppBox Sessions autoincrement
49,241
public function setNotificationMethod ( $ methodName ) { if ( trim ( $ methodName ) == '' ) { $ methodName = self :: NOTIFY_MAIL ; } $ this -> notificationMethod = $ methodName ; }
Sets the name of the notification method to handle this order s status change notifications .
49,242
public function prepareDownload ( Request $ request , Token $ token ) { if ( false === $ list = @ unserialize ( $ token -> getData ( ) ) ) { $ this -> app -> abort ( 500 , 'Invalid datas' ) ; } if ( ! is_array ( $ list ) ) { $ this -> app -> abort ( 500 , 'Invalid datas' ) ; } foreach ( [ 'export_name' , 'files' ] as $...
Prepare a set of documents for download
49,243
public function downloadExecute ( Token $ token ) { if ( false === $ list = @ unserialize ( $ token -> getData ( ) ) ) { return $ this -> app -> json ( [ 'success' => false , 'message' => 'Invalid datas' ] ) ; } set_time_limit ( 0 ) ; $ session = $ this -> app [ 'session' ] ; $ session -> save ( ) ; ignore_user_abort (...
Build a zip of downloaded documents
49,244
public static function applyBooleanClause ( $ query , $ type , array $ clause ) { if ( ! in_array ( $ type , [ 'must' , 'should' ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Type must be either "must" or "should", "%s" given' , $ type ) ) ; } if ( $ query === null ) { return $ clause ; } if ( ! is_array ( ...
Apply conjunction or disjunction between a query and a sub query clause
49,245
public function removeExpiredTokens ( ) { foreach ( $ this -> repository -> findExpiredTokens ( ) as $ token ) { switch ( $ token -> getType ( ) ) { case 'download' : case 'email' : $ file = $ this -> temporaryDownloadPath . '/' . $ token -> getValue ( ) . '.zip' ; if ( is_file ( $ file ) ) { unlink ( $ file ) ; } brea...
Removes expired tokens
49,246
public function indexScheduled ( BulkOperation $ bulk , databox $ databox ) { $ submitted_records = [ ] ; $ delegate = new ScheduledFetcherDelegate ( ) ; $ fetcher = $ this -> fetcherFactory -> createFetcher ( $ databox , $ delegate ) ; $ fetcher -> setPostFetch ( function ( array $ records ) use ( $ databox , $ fetche...
Index the records flagged as to_index on databox called by task indexer
49,247
public function index ( BulkOperation $ bulk , Iterator $ records ) { foreach ( $ this -> createFetchersForRecords ( $ records ) as $ fetcher ) { $ submitted_records = [ ] ; $ databox = $ fetcher -> getDatabox ( ) ; $ fetcher -> setPostFetch ( function ( array $ records ) use ( $ fetcher , $ databox ) { RecordQueuer ::...
Index a list of records
49,248
public function delete ( BulkOperation $ bulk , Iterator $ records ) { foreach ( $ records as $ record ) { $ bulk -> delete ( [ 'id' => $ record -> getId ( ) , 'type' => self :: TYPE_NAME ] , null ) ; } }
Deleta a list of records
49,249
public function form ( $ type = 'form' , $ data = null , array $ options = [ ] , FormBuilderInterface $ parent = null ) { return $ this [ 'form.factory' ] -> create ( $ type , $ data , $ options , $ parent ) ; }
Returns a form .
49,250
public function addFlash ( $ type , $ message ) { if ( ! in_array ( $ type , self :: $ flashTypes ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid flash message type `%s`, valid type are %s' , $ type , implode ( ', ' , self :: $ flashTypes ) ) ) ; } $ this [ 'session' ] -> getFlashBag ( ) -> add ( $ type ,...
Adds a flash message for type .
49,251
public function isGuestAllowed ( ) { if ( null === $ user = $ this [ 'repo.users' ] -> findByLogin ( User :: USER_GUEST ) ) { return false ; } return count ( $ this -> getAclForUser ( $ user ) -> get_granted_base ( ) ) > 0 ; }
Returns true if guest access is allowed .
49,252
public function bindRoutes ( ) { $ loader = new RouteLoader ( ) ; $ loader -> registerProviders ( RouteLoader :: $ defaultProviders ) ; $ loader -> bindRoutes ( $ this ) ; $ this -> bindPluginRoutes ( 'plugin.controller_providers.root' ) ; }
Mount all controllers
49,253
public static function fromArray ( array $ options ) { $ defaultOptions = [ 'host' => '127.0.0.1' , 'port' => 9200 , 'index' => '' , 'shards' => 3 , 'replicas' => 0 , 'minScore' => 4 , 'highlight' => true , 'populate_order' => self :: POPULATE_ORDER_RID , 'populate_direction' => self :: POPULATE_DIRECTION_DESC , 'activ...
Factory method to hydrate an instance from serialized options
49,254
public function findUserList ( User $ user ) { $ dql = 'SELECT e FROM Phraseanet:UsrListEntry e WHERE e.user = :usr_id' ; $ params = [ 'usr_id' => $ user -> getId ( ) , ] ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameters ( $ params ) ; return $ query -> getResult ( ) ; }
Get all lists entries matching a given User
49,255
public function listElement ( Request $ request ) { $ baseIds = array_keys ( $ this -> getAclForUser ( ) -> get_granted_base ( [ \ ACL :: CANADDRECORD ] ) ) ; $ lazaretFiles = null ; $ perPage = 10 ; $ page = max ( 1 , $ request -> query -> get ( 'page' , 1 ) ) ; $ offset = ( $ page - 1 ) * $ perPage ; if ( count ( $ b...
List all elements in lazaret
49,256
public function getElement ( $ file_id ) { $ ret = [ 'success' => false , 'message' => '' , 'result' => [ ] ] ; $ lazaretFile = $ this -> getLazaretFileRepository ( ) -> find ( $ file_id ) ; if ( null === $ lazaretFile ) { $ ret [ 'message' ] = $ this -> app -> trans ( 'File is not present in quarantine anymore, please...
Get one lazaret Element
49,257
public function addElement ( Request $ request , $ file_id ) { $ ret = [ 'success' => false , 'message' => '' , 'result' => [ ] ] ; if ( null === $ request -> request -> get ( 'bas_id' ) ) { $ ret [ 'message' ] = $ this -> app -> trans ( 'You must give a destination collection' ) ; return $ this -> app -> json ( $ ret ...
Add an element to phraseanet
49,258
public function denyElement ( $ file_id ) { $ lazaretManipulator = $ this -> app [ 'manipulator.lazaret' ] ; $ ret = $ lazaretManipulator -> deny ( $ file_id ) ; return $ this -> app -> json ( $ ret ) ; }
Delete a lazaret element
49,259
public function acceptElement ( Request $ request , $ file_id ) { $ ret = [ 'success' => false , 'message' => '' , 'result' => [ ] ] ; if ( null === $ recordId = $ request -> request -> get ( 'record_id' ) ) { $ ret [ 'message' ] = $ this -> app -> trans ( 'You must give a destination record' ) ; return $ this -> app -...
Substitute a record element by a lazaret element
49,260
public function thumbnailElement ( $ file_id ) { $ lazaretFile = $ this -> getLazaretFileRepository ( ) -> find ( $ file_id ) ; if ( null === $ lazaretFile ) { return new Response ( null , 404 ) ; } $ lazaretThumbFileName = $ this -> app [ 'tmp.lazaret.path' ] . '/' . $ lazaretFile -> getThumbFilename ( ) ; return $ th...
Get the associated lazaret element thumbnail
49,261
public function getStructure ( \ databox $ databox ) { $ databox_id = $ databox -> get_sbas_id ( ) ; if ( isset ( $ this -> statusStructure [ $ databox_id ] ) ) { return $ this -> statusStructure [ $ databox_id ] ; } $ this -> statusStructure [ $ databox_id ] = $ this -> provider -> getStructure ( $ databox ) ; return ...
Get the status structure according to the given databox
49,262
public function apply ( Application $ app ) { $ applied = [ ] ; foreach ( $ this -> upgrades as $ upgrade ) { if ( $ upgrade -> isApplyable ( $ app ) ) { try { $ upgrade -> apply ( $ app [ 'orm.em' ] , $ app [ 'phraseanet.appbox' ] , $ app [ 'doctrine-migration.configuration' ] ) ; $ applied [ ] = $ upgrade ; } catch (...
Applies all applyable upgrades
49,263
public function getRedisConnection ( array $ options = [ ] ) { $ options = array_replace ( [ 'host' => 'localhost' , 'port' => 6379 ] , $ options ) ; if ( null !== $ cache = $ this -> getConnection ( 'redis' , $ options ) ) { return $ cache ; } if ( ! extension_loaded ( 'redis' ) ) { throw new RuntimeException ( 'The R...
Returns a Redis connection .
49,264
public function getMemcacheConnection ( array $ options = [ ] ) { $ options = array_replace ( [ 'host' => 'localhost' , 'port' => 11211 ] , $ options ) ; if ( null !== $ cache = $ this -> getConnection ( 'memcache' , $ options ) ) { return $ cache ; } if ( ! extension_loaded ( 'memcache' ) ) { throw new RuntimeExceptio...
Returns a Memcache connection .
49,265
public function getMemcachedConnection ( array $ options = [ ] ) { $ options = array_replace ( [ 'host' => 'localhost' , 'port' => 11211 ] , $ options ) ; if ( null !== $ cache = $ this -> getConnection ( 'memcached' , $ options ) ) { return $ cache ; } if ( ! extension_loaded ( 'memcached' ) ) { throw new RuntimeExcep...
Returns a Memcached connection .
49,266
public function getRecordsToSubstitute ( Application $ app , $ includeReason = false ) { $ merged = [ ] ; foreach ( $ this -> getChecks ( ) as $ check ) { $ conflicts = $ check -> listConflicts ( $ app ) ; foreach ( $ conflicts as $ record ) { if ( $ includeReason ) { if ( ! array_key_exists ( $ record -> getRecordId (...
Get an array of records that can be substitued by the Lazaret file
49,267
public function saveFailure ( $ username , Request $ request ) { $ this -> removeOldFailures ( ) ; $ failure = new AuthFailure ( ) ; $ failure -> setIp ( $ request -> getClientIp ( ) ) ; $ failure -> setUsername ( $ username ) ; $ failure -> setLocked ( true ) ; $ this -> em -> persist ( $ failure ) ; $ this -> em -> f...
Saves an authentication failure
49,268
public function checkFailures ( $ username , Request $ request ) { $ failures = $ this -> repository -> findLockedFailuresMatching ( $ username , $ request -> getClientIp ( ) ) ; if ( 0 === count ( $ failures ) ) { return $ this ; } if ( $ this -> trials < count ( $ failures ) && $ this -> captcha -> isSetup ( ) ) { $ ...
Checks a request for previous failures
49,269
public function getSchedulerAction ( Request $ request ) { $ information = $ this -> app [ 'task-manager.live-information' ] ; $ data = $ information -> getManager ( ) ; return Result :: create ( $ request , [ 'scheduler' => [ 'configuration' => $ data [ 'configuration' ] , 'state' => $ data [ 'actual' ] , 'status' => ...
Return an array of key - values information about scheduler
49,270
public function getDataboxCollectionsAction ( Request $ request , $ databox_id ) { $ ret = [ "collections" => $ this -> listDataboxCollections ( $ this -> findDataboxById ( $ databox_id ) ) , ] ; return Result :: create ( $ request , $ ret ) -> createResponse ( ) ; }
Get a Response containing the collections of a \ databox
49,271
public function getDataboxStatusAction ( Request $ request , $ databox_id ) { $ ret = [ "status" => $ this -> listDataboxStatus ( $ this -> findDataboxById ( $ databox_id ) -> getStatusStructure ( ) ) ] ; return Result :: create ( $ request , $ ret ) -> createResponse ( ) ; }
Get a Response containing the status of a \ databox
49,272
public function getDataboxTermsAction ( Request $ request , $ databox_id ) { $ ret = [ "termsOfUse" => $ this -> listDataboxTerms ( $ this -> findDataboxById ( $ databox_id ) ) ] ; return Result :: create ( $ request , $ ret ) -> createResponse ( ) ; }
Get a Response containing the terms of use of a \ databox
49,273
private function listDataboxTerms ( \ databox $ databox ) { $ ret = [ ] ; foreach ( $ databox -> get_cgus ( ) as $ locale => $ array_terms ) { $ ret [ ] = [ 'locale' => $ locale , 'terms' => $ array_terms [ 'value' ] ] ; } return $ ret ; }
Retrieve CGU s for the specified \ databox
49,274
public function searchAction ( Request $ request ) { $ subdefTransformer = new SubdefTransformer ( $ this -> app [ 'acl' ] , $ this -> getAuthenticatedUser ( ) , new PermalinkTransformer ( ) ) ; $ technicalDataTransformer = new TechnicalDataTransformer ( ) ; $ recordTransformer = new RecordTransformer ( $ subdefTransfo...
Search for results
49,275
public function searchRecordsAction ( Request $ request ) { $ subdefTransformer = new SubdefTransformer ( $ this -> app [ 'acl' ] , $ this -> getAuthenticatedUser ( ) , new PermalinkTransformer ( ) ) ; $ technicalDataTransformer = new TechnicalDataTransformer ( ) ; $ recordTransformer = new RecordTransformer ( $ subdef...
Get a Response containing the results of a records search
49,276
private function resolveSearchIncludes ( Request $ request ) { $ includes = [ 'results.stories.records' ] ; if ( $ request -> attributes -> get ( '_extended' , false ) ) { if ( $ request -> get ( 'search_type' ) != SearchEngineOptions :: RECORD_STORY ) { $ includes = array_merge ( $ includes , [ 'results.stories.record...
Returns requested includes
49,277
private function listRecord ( Request $ request , \ record_adapter $ record ) { $ technicalInformation = [ ] ; foreach ( $ record -> get_technical_infos ( ) -> getValues ( ) as $ name => $ value ) { $ technicalInformation [ ] = [ 'name' => $ name , 'value' => $ value ] ; } $ data = [ 'databox_id' => $ record -> getData...
Retrieve detailed information about one record
49,278
private function listStory ( Request $ request , \ record_adapter $ story ) { if ( ! $ story -> isStory ( ) ) { return Result :: createError ( $ request , 404 , 'Story not found' ) -> createResponse ( ) ; } $ caption = $ story -> get_caption ( ) ; $ format = function ( \ caption_record $ caption , $ dcField ) { $ field...
Retrieve detailed information about one story
49,279
public function getRecordMetadataAction ( Request $ request , $ databox_id , $ record_id ) { $ record = $ this -> findDataboxById ( $ databox_id ) -> get_record ( $ record_id ) ; $ ret = [ "record_metadatas" => $ this -> listRecordMetadata ( $ record ) ] ; return Result :: create ( $ request , $ ret ) -> createResponse...
Get a Response containing the record metadata
49,280
private function listRecordMetadata ( \ record_adapter $ record ) { $ includeBusiness = $ this -> getAclForUser ( ) -> can_see_business_fields ( $ record -> getDatabox ( ) ) ; return $ this -> listRecordCaptionFields ( $ record -> get_caption ( ) -> get_fields ( null , $ includeBusiness ) ) ; }
List all fields of given record
49,281
public function getRecordStatusAction ( Request $ request , $ databox_id , $ record_id ) { $ record = $ this -> findDataboxById ( $ databox_id ) -> get_record ( $ record_id ) ; $ ret = [ "status" => $ this -> listRecordStatus ( $ record ) ] ; return Result :: create ( $ request , $ ret ) -> createResponse ( ) ; }
Get a Response containing the record status
49,282
private function listRecordStatus ( \ record_adapter $ record ) { $ ret = [ ] ; foreach ( $ record -> getStatusStructure ( ) as $ bit => $ status ) { $ ret [ ] = [ 'bit' => $ bit , 'state' => \ databox_status :: bitIsSet ( $ record -> getStatusBitField ( ) , $ bit ) , ] ; } return $ ret ; }
Retrieve detailed information about one status
49,283
public function getRelatedRecordsAction ( Request $ request , $ databox_id , $ record_id ) { $ record = $ this -> findDataboxById ( $ databox_id ) -> get_record ( $ record_id ) ; $ baskets = array_map ( function ( Basket $ basket ) { return $ this -> listBasket ( $ basket ) ; } , ( array ) $ record -> get_container_bas...
Get a Response containing the baskets where the record is in
49,284
private function listBasket ( Basket $ basket ) { $ ret = [ 'basket_id' => $ basket -> getId ( ) , 'owner' => $ this -> listUser ( $ basket -> getUser ( ) ) , 'created_on' => $ basket -> getCreated ( ) -> format ( DATE_ATOM ) , 'description' => ( string ) $ basket -> getDescription ( ) , 'name' => $ basket -> getName (...
Retrieve information about one basket
49,285
public function getRecordAction ( Request $ request , $ databox_id , $ record_id ) { try { $ record = $ this -> findDataboxById ( $ databox_id ) -> get_record ( $ record_id ) ; return Result :: create ( $ request , [ 'record' => $ this -> listRecord ( $ request , $ record ) ] ) -> createResponse ( ) ; } catch ( NotFoun...
Return detailed information about one record
49,286
public function setRecordCollectionAction ( Request $ request , $ databox_id , $ record_id ) { $ databox = $ this -> findDataboxById ( $ databox_id ) ; $ record = $ databox -> get_record ( $ record_id ) ; try { $ collection = \ collection :: getByBaseId ( $ this -> app , $ request -> get ( 'base_id' ) ) ; $ record -> m...
Move a record to another collection
49,287
public function createBasketAction ( Request $ request ) { $ name = $ request -> get ( 'name' ) ; if ( trim ( strip_tags ( $ name ) ) === '' ) { return $ this -> getBadRequestAction ( $ request , 'Missing basket name parameter' ) ; } $ Basket = new Basket ( ) ; $ Basket -> setUser ( $ this -> getAuthenticatedUser ( ) )...
Create a new basket
49,288
public function getBasketAction ( Request $ request , Basket $ basket ) { $ ret = [ "basket" => $ this -> listBasket ( $ basket ) , "basket_elements" => $ this -> listBasketContent ( $ request , $ basket ) , ] ; return Result :: create ( $ request , $ ret ) -> createResponse ( ) ; }
Retrieve a basket
49,289
private function listBasketContent ( Request $ request , Basket $ basket ) { return array_map ( function ( BasketElement $ element ) use ( $ request ) { return $ this -> listBasketElement ( $ request , $ element ) ; } , iterator_to_array ( $ basket -> getElements ( ) ) ) ; }
Retrieve elements of one basket
49,290
private function listBasketElement ( Request $ request , BasketElement $ basket_element ) { $ ret = [ 'basket_element_id' => $ basket_element -> getId ( ) , 'order' => $ basket_element -> getOrd ( ) , 'record' => $ this -> listRecord ( $ request , $ basket_element -> getRecord ( $ this -> app ) ) , 'validation_item' =>...
Retrieve detailed information about a basket element
49,291
public function setBasketTitleAction ( Request $ request , Basket $ basket ) { $ basket -> setName ( $ request -> get ( 'name' ) ) ; $ em = $ this -> app [ 'orm.em' ] ; $ em -> persist ( $ basket ) ; $ em -> flush ( ) ; return Result :: create ( $ request , [ "basket" => $ this -> listBasket ( $ basket ) ] ) -> createR...
Change the name of one basket
49,292
public function setBasketDescriptionAction ( Request $ request , Basket $ basket ) { $ basket -> setDescription ( $ request -> get ( 'description' ) ) ; $ em = $ this -> app [ 'orm.em' ] ; $ em -> persist ( $ basket ) ; $ em -> flush ( ) ; return Result :: create ( $ request , [ "basket" => $ this -> listBasket ( $ bas...
Change the description of one basket
49,293
public function deleteBasketAction ( Request $ request , Basket $ basket ) { $ em = $ this -> app [ 'orm.em' ] ; $ em -> remove ( $ basket ) ; $ em -> flush ( ) ; return $ this -> searchBasketsAction ( $ request ) ; }
Delete a basket
49,294
public function searchPublicationsAction ( Request $ request ) { $ user = $ this -> getAuthenticatedUser ( ) ; $ feedsRepository = $ this -> app [ 'repo.feeds' ] ; $ coll = $ feedsRepository -> getAllForUser ( $ this -> getAclForUser ( $ user ) ) ; $ data = array_map ( function ( $ feed ) use ( $ user ) { return $ this...
List all available feeds
49,295
private function listPublication ( Feed $ feed , User $ user = null ) { return [ 'id' => $ feed -> getId ( ) , 'title' => $ feed -> getTitle ( ) , 'subtitle' => $ feed -> getSubtitle ( ) , 'total_entries' => $ feed -> getCountTotalEntries ( ) , 'icon' => $ feed -> getIconUrl ( ) , 'public' => $ feed -> isPublic ( ) , '...
Retrieve detailed information about one feed
49,296
private function listPublicationsEntries ( Request $ request , FeedInterface $ feed , $ offset_start = 0 , $ how_many = 5 ) { return array_map ( function ( $ entry ) use ( $ request ) { return $ this -> listPublicationEntry ( $ request , $ entry ) ; } , $ feed -> getEntries ( ) -> slice ( $ offset_start , $ how_many ) ...
Retrieve all entries of one feed
49,297
private function listPublicationEntry ( Request $ request , FeedEntry $ entry ) { $ items = array_map ( function ( $ item ) use ( $ request ) { return $ this -> listPublicationEntryItem ( $ request , $ item ) ; } , iterator_to_array ( $ entry -> getItems ( ) ) ) ; return [ 'id' => $ entry -> getId ( ) , 'author_email' ...
Retrieve detailed information about one feed entry
49,298
private function listPublicationEntryItem ( Request $ request , FeedItem $ item ) { return [ 'item_id' => $ item -> getId ( ) , 'record' => $ this -> listRecord ( $ request , $ item -> getRecord ( $ this -> app ) ) , ] ; }
Retrieve detailed information about one feed entry item
49,299
public function getPublicationAction ( Request $ request , $ feed_id ) { $ user = $ this -> getAuthenticatedUser ( ) ; $ repository = $ this -> app [ 'repo.feeds' ] ; $ feed = $ repository -> find ( $ feed_id ) ; if ( ! $ feed -> isAccessible ( $ user , $ this -> app ) ) { return Result :: create ( $ request , [ ] ) ->...
Retrieve one feed