idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
14,800
public function authentication ( $ username , $ password ) { $ endpoint = sprintf ( 'authentication?username=%s' , urlencode ( $ username ) ) ; $ parameters [ 'value' ] = $ password ; return $ this -> apiClient -> callEndpoint ( $ endpoint , $ parameters , null , HttpMethod :: REQUEST_POST ) ; }
Authenticate user with Crowd
14,801
public function getExtraFormConstraints ( ) { if ( null === $ this -> extraFormType ) { return null ; } $ configurationArray = json_decode ( $ this -> configuration , true ) ; return $ configurationArray [ 'extra_form_constraints' ] ; }
Get extra form constraints .
14,802
protected function _theme ( $ theme_name = NULL , $ options = array ( ) ) { if ( count ( $ options ) > 0 ) { foreach ( $ options as $ opt => $ value ) { if ( ! array_key_exists ( $ opt , $ this -> _recaptchaOptions ) ) { unset ( $ options [ $ opt ] ) ; } } } foreach ( $ this -> _recaptchaOptions as $ key => $ value ) {...
Standard Theme Display s Theme customization for reCAPTCHA widget by writting a snippet for Standard_Themes and Custom_Theming
14,803
protected function i18n ( $ key = NULL , $ path = NULL ) { static $ RECAPTCHA_LANG ; if ( $ RECAPTCHA_LANG ) { return isset ( $ key ) ? $ RECAPTCHA_LANG [ $ key ] : $ RECAPTCHA_LANG ; } if ( ! isset ( $ this -> _recaptchaOptions [ 'lang' ] ) ) { $ language = $ this -> clientLang ( ) ; } else { $ language = $ this -> _r...
Fetch I18n language line
14,804
public function clientLang ( ) { if ( isset ( $ _SERVER [ 'HTTP_ACCEPT_LANGUAGE' ] ) ) { $ language = explode ( ',' , preg_replace ( '/(;\s?q=[0-9\.]+)|\s/i' , '' , strtolower ( trim ( $ _SERVER [ 'HTTP_ACCEPT_LANGUAGE' ] ) ) ) ) ; return strtolower ( $ language [ 0 ] ) ; } return ; }
Get user s browser language preference
14,805
private function isEnabled ( ) { if ( ! $ this -> enabled ) { return false ; } if ( $ this -> authorizationChecker ) { foreach ( $ this -> trustedRoles as $ trustedRole ) { if ( $ this -> authorizationChecker -> isGranted ( $ trustedRole ) ) { return false ; } } } return true ; }
Is the recaptcha form field enabled ?
14,806
public static function init ( ) { $ className = get_called_class ( ) ; if ( empty ( static :: $ _fieldsDefined [ $ className ] ) ) { static :: _defineFields ( ) ; static :: _initFields ( ) ; static :: $ _fieldsDefined [ $ className ] = true ; } if ( empty ( static :: $ _relationshipsDefined [ $ className ] ) && static ...
init Initializes the model by checking the ancestor tree for the existence of various config fields and merges them .
14,807
public function setValue ( $ name , $ value ) { if ( static :: fieldExists ( $ name ) ) { $ this -> _setFieldValue ( $ name , $ value ) ; } else { return false ; } }
Sets a value on this model .
14,808
public static function create ( $ values = [ ] , $ save = false ) { $ className = get_called_class ( ) ; $ ActiveRecord = new $ className ( ) ; $ ActiveRecord -> setFields ( $ values ) ; if ( $ save ) { $ ActiveRecord -> save ( ) ; } return $ ActiveRecord ; }
Create a new object from this model .
14,809
public function changeClass ( $ className = false , $ fieldValues = false ) { if ( ! $ className ) { return $ this ; } $ this -> _record [ static :: _cn ( 'Class' ) ] = $ className ; $ ActiveRecord = new $ className ( $ this -> _record , true , $ this -> isPhantom ) ; if ( $ fieldValues ) { $ ActiveRecord -> setFields ...
Used to instantiate a new model of a different class with this model s field s . Useful when you have similar classes or subclasses with the same parent .
14,810
public function setFields ( $ values ) { foreach ( $ values as $ field => $ value ) { $ this -> _setFieldValue ( $ field , $ value ) ; } }
Change multiple fields in the model with an array .
14,811
public function getData ( ) { $ data = [ ] ; foreach ( static :: $ _classFields [ get_called_class ( ) ] as $ field => $ options ) { $ data [ $ field ] = $ this -> _getFieldValue ( $ field ) ; } if ( $ this -> validationErrors ) { $ data [ 'validationErrors' ] = $ this -> validationErrors ; } return $ data ; }
Gets normalized object data .
14,812
public function save ( $ deep = true ) { $ this -> beforeSave ( ) ; if ( static :: isVersioned ( ) ) { $ this -> beforeVersionedSave ( ) ; } if ( static :: fieldExists ( 'Created' ) && ( ! $ this -> Created || ( $ this -> Created == 'CURRENT_TIMESTAMP' ) ) ) { $ this -> Created = time ( ) ; } if ( ! $ this -> validate ...
Saves this object to the database currently in use .
14,813
public function destroy ( ) { if ( static :: isVersioned ( ) ) { if ( static :: $ createRevisionOnDestroy ) { if ( $ this -> fieldExists ( 'Created' ) ) { $ this -> Created = time ( ) ; } $ recordValues = $ this -> _prepareRecordValues ( ) ; $ set = static :: _mapValuesToSet ( $ recordValues ) ; DB :: nonQuery ( 'INSER...
Deletes this object .
14,814
public static function delete ( $ id ) { DB :: nonQuery ( 'DELETE FROM `%s` WHERE `%s` = %u' , [ static :: $ tableName , static :: _cn ( static :: $ primaryKey ? static :: $ primaryKey : 'ID' ) , $ id , ] , [ static :: class , 'handleError' ] ) ; return DB :: affectedRows ( ) > 0 ; }
Delete by ID
14,815
public static function getByID ( $ id ) { $ record = static :: getRecordByField ( static :: $ primaryKey ? static :: $ primaryKey : 'ID' , $ id , true ) ; return static :: instantiateRecord ( $ record ) ; }
Get model object by primary key .
14,816
public static function getByField ( $ field , $ value , $ cacheIndex = false ) { $ record = static :: getRecordByField ( $ field , $ value , $ cacheIndex ) ; return static :: instantiateRecord ( $ record ) ; }
Get model object by field .
14,817
public static function getRecordByField ( $ field , $ value , $ cacheIndex = false ) { $ query = 'SELECT * FROM `%s` WHERE `%s` = "%s" LIMIT 1' ; $ params = [ static :: $ tableName , static :: _cn ( $ field ) , DB :: escape ( $ value ) , ] ; if ( $ cacheIndex ) { $ key = sprintf ( '%s/%s:%s' , static :: $ tableName , $...
Get record by field .
14,818
public static function getRecordByWhere ( $ conditions , $ options = [ ] ) { if ( ! is_array ( $ conditions ) ) { $ conditions = [ $ conditions ] ; } $ options = Util :: prepareOptions ( $ options , [ 'order' => false , ] ) ; $ conditions = static :: _mapConditions ( $ conditions ) ; $ order = $ options [ 'order' ] ? s...
Get the first result as an array from a simple select query with a where clause you can provide .
14,819
public static function getAllByContextObject ( ActiveRecord $ Record , $ options = [ ] ) { return static :: getAllByContext ( $ Record :: $ rootClass , $ Record -> getPrimaryKeyValue ( ) , $ options ) ; }
Get all models in the database by passing in an ActiveRecord model which has a ContextClass field by the passed in records primary key .
14,820
public static function buildExtraColumns ( $ columns ) { if ( ! empty ( $ columns ) ) { if ( is_array ( $ columns ) ) { foreach ( $ columns as $ key => $ value ) { return ', ' . $ value . ' AS ' . $ key ; } } else { return ', ' . $ columns ; } } }
Builds the extra columns you might want to add to a database select query after the initial list of model fields .
14,821
public static function buildHaving ( $ having ) { if ( ! empty ( $ having ) ) { return ' HAVING (' . ( is_array ( $ having ) ? join ( ') AND (' , static :: _mapConditions ( $ having ) ) : $ having ) . ')' ; } }
Builds the HAVING clause of a MySQL database query .
14,822
public static function getAllRecordsByWhere ( $ conditions = [ ] , $ options = [ ] ) { $ className = get_called_class ( ) ; $ options = Util :: prepareOptions ( $ options , [ 'indexField' => false , 'order' => false , 'limit' => false , 'offset' => 0 , 'calcFoundRows' => ! empty ( $ options [ 'limit' ] ) , 'extraColumn...
Gets database results as array from a simple select query with a where clause you can provide .
14,823
public static function getAllRecords ( $ options = [ ] ) { $ options = Util :: prepareOptions ( $ options , [ 'indexField' => false , 'order' => false , 'limit' => false , 'calcFoundRows' => false , 'offset' => 0 , ] ) ; $ query = 'SELECT ' . ( $ options [ 'calcFoundRows' ] ? 'SQL_CALC_FOUND_ROWS' : '' ) . '* FROM `%s`...
Attempts to get all database records for this class and returns them as is from the database .
14,824
public static function instantiateRecords ( $ records ) { foreach ( $ records as & $ record ) { $ className = static :: _getRecordClass ( $ record ) ; $ record = new $ className ( $ record ) ; } return $ records ; }
Converts an array of database records to a model corresponding to each record . Will attempt to use the record s Class field value to as the class to instantiate as or the name of this class if none is provided .
14,825
public static function getFieldOptions ( $ field , $ optionKey = false ) { if ( $ optionKey ) { return static :: $ _classFields [ get_called_class ( ) ] [ $ field ] [ $ optionKey ] ; } else { return static :: $ _classFields [ get_called_class ( ) ] [ $ field ] ; } }
Returns either a field option or an array of all the field options .
14,826
public static function getColumnName ( $ field ) { static :: init ( ) ; if ( ! static :: fieldExists ( $ field ) ) { throw new Exception ( 'getColumnName called on nonexisting column: ' . get_called_class ( ) . '->' . $ field ) ; } return static :: $ _classFields [ get_called_class ( ) ] [ $ field ] [ 'columnName' ] ; ...
Returns columnName for given field
14,827
public function getValidationError ( $ field ) { $ crumbs = explode ( '.' , $ field ) ; $ cur = & $ this -> _validationErrors ; while ( $ crumb = array_shift ( $ crumbs ) ) { if ( array_key_exists ( $ crumb , $ cur ) ) { $ cur = & $ cur [ $ crumb ] ; } else { return null ; } } return $ cur ; }
Get a validation error for a given field .
14,828
protected static function _getRecordClass ( $ record ) { $ static = get_called_class ( ) ; if ( ! static :: fieldExists ( 'Class' ) ) { return $ static ; } $ columnName = static :: _cn ( 'Class' ) ; if ( ! empty ( $ record [ $ columnName ] ) && is_subclass_of ( $ record [ $ columnName ] , $ static ) ) { return $ record...
Returns class name for instantiating given record
14,829
protected function _getFieldValue ( $ field , $ useDefault = true ) { $ fieldOptions = static :: $ _classFields [ get_called_class ( ) ] [ $ field ] ; if ( isset ( $ this -> _record [ $ fieldOptions [ 'columnName' ] ] ) ) { $ value = $ this -> _record [ $ fieldOptions [ 'columnName' ] ] ; switch ( $ fieldOptions [ 'typ...
Retrieves given field s value
14,830
protected function _setFieldValue ( $ field , $ value ) { if ( static :: isVersioned ( ) ) { if ( array_key_exists ( $ field , static :: $ versioningFields ) ) { return false ; } } if ( ! static :: fieldExists ( $ field ) ) { return false ; } $ fieldOptions = static :: $ _classFields [ get_called_class ( ) ] [ $ field ...
Sets given field s value
14,831
public function findPublishedByAlias ( $ strAlias , array $ arrOptions = array ( ) ) { $ t = static :: $ strTable ; $ arrColumns = array ( "$t.alias=? AND $t.invisible=''" ) ; return static :: findOneBy ( $ arrColumns , $ strAlias , $ arrOptions ) ; }
Find published content elements by their alias
14,832
public function preSubmitData ( FormEvent $ event ) { $ form = $ event -> getForm ( ) ; $ data = $ event -> getData ( ) ; if ( null === $ data || '' === $ data ) { $ data = array ( ) ; } foreach ( $ form as $ name => $ child ) { if ( ! isset ( $ data [ $ name ] ) ) { $ form -> remove ( $ name ) ; } } }
Pre submit data .
14,833
public function buildCollection ( FormEvent $ event , $ eventName ) { $ form = $ event -> getForm ( ) ; for ( $ i = 0 ; $ i < $ this -> options [ 'max_items' ] ; ++ $ i ) { $ required = $ i < $ this -> options [ 'min_items' ] ? true : false ; $ displayed = $ i < $ this -> options [ 'min_items' ] || $ this -> isDisplaya...
Build collection .
14,834
public function changeData ( FormEvent $ event ) { $ data = $ event -> getData ( ) ; if ( null === $ data ) { $ data = array ( ) ; } if ( $ data instanceof \ Doctrine \ Common \ Collections \ Collection ) { $ event -> setData ( $ data -> getValues ( ) ) ; } else { $ event -> setData ( array_values ( $ data ) ) ; } }
Change data .
14,835
public function onSubmit ( FormEvent $ event ) { $ form = $ event -> getForm ( ) ; $ data = $ event -> getData ( ) ; if ( null === $ data ) { $ data = array ( ) ; } if ( ! is_array ( $ data ) && ! ( $ data instanceof \ Traversable && $ data instanceof \ ArrayAccess ) ) { throw new UnexpectedTypeException ( $ data , 'ar...
On submit .
14,836
protected function isDisplayable ( FormEvent $ event , $ i , $ eventName ) { $ form = $ event -> getForm ( ) ; $ data = $ event -> getData ( ) ; if ( ! isset ( $ data [ $ i ] ) ) { return false ; } $ item = is_object ( $ data [ $ i ] ) ? ( array ) $ data [ $ i ] : $ data [ $ i ] ; if ( ! is_array ( $ item ) ) { return ...
Is displayable .
14,837
public static function getCreateTable ( $ recordClass , $ historyVariant = false ) { $ indexes = $ historyVariant ? [ ] : $ recordClass :: $ indexes ; $ fulltextColumns = [ ] ; $ queryString = [ ] ; if ( $ historyVariant ) { $ queryString [ ] = '`RevisionID` int(10) unsigned NOT NULL auto_increment' ; $ queryString [ ]...
Generates a MySQL create table query from a Divergence \ Models \ ActiveRecord class .
14,838
public function stop ( ) { if ( ! $ this -> running ) { return ; } $ this -> running = false ; $ promise = call ( function ( ) { $ promises = [ ] ; foreach ( clone $ this -> workers as $ worker ) { \ assert ( $ worker instanceof Internal \ IpcParent ) ; $ promises [ ] = call ( function ( ) use ( $ worker ) { list ( $ p...
Stops the cluster .
14,839
public static function escape ( $ data ) { if ( is_string ( $ data ) ) { $ data = static :: getConnection ( ) -> quote ( $ data ) ; $ data = substr ( $ data , 1 , strlen ( $ data ) - 2 ) ; return $ data ; } elseif ( is_array ( $ data ) ) { foreach ( $ data as $ key => $ string ) { if ( is_string ( $ string ) ) { $ data...
Recursive escape for strings or arrays of strings .
14,840
public static function allRecords ( $ query , $ parameters = [ ] , $ errorHandler = null ) { $ result = static :: query ( $ query , $ parameters , $ errorHandler ) ; $ records = [ ] ; while ( $ record = $ result -> fetch ( PDO :: FETCH_ASSOC ) ) { $ records [ ] = $ record ; } return $ records ; }
Runs a query and returns all results as an associative array .
14,841
public static function allValues ( $ valueKey , $ query , $ parameters = [ ] , $ errorHandler = null ) { $ result = static :: query ( $ query , $ parameters , $ errorHandler ) ; $ records = [ ] ; while ( $ record = $ result -> fetch ( PDO :: FETCH_ASSOC ) ) { $ records [ ] = $ record [ $ valueKey ] ; } return $ records...
Gets you some column from every record .
14,842
public static function oneRecordCached ( $ cacheKey , $ query , $ parameters = [ ] , $ errorHandler = null ) { if ( array_key_exists ( $ cacheKey , static :: $ _record_cache ) ) { return static :: $ _record_cache [ $ cacheKey ] ; } $ result = static :: query ( $ query , $ parameters , $ errorHandler ) ; $ record = $ re...
Returns the first database record from a query with caching
14,843
public static function oneRecord ( $ query , $ parameters = [ ] , $ errorHandler = null ) { $ result = static :: query ( $ query , $ parameters , $ errorHandler ) ; $ record = $ result -> fetch ( PDO :: FETCH_ASSOC ) ; return $ record ; }
Returns the first database record from a query .
14,844
public static function oneValue ( $ query , $ parameters = [ ] , $ errorHandler = null ) { $ record = static :: oneRecord ( $ query , $ parameters , $ errorHandler ) ; if ( $ record ) { return array_shift ( $ record ) ; } else { return false ; } }
Returns the first value of the first database record from a query .
14,845
public static function handleError ( $ query = '' , $ queryLog = false , $ errorHandler = null ) { if ( is_callable ( $ errorHandler , false , $ callable ) ) { return call_user_func ( $ errorHandler , $ query , $ queryLog ) ; } if ( $ queryLog ) { $ error = static :: getConnection ( ) -> errorInfo ( ) ; $ queryLog [ 'e...
Handles any errors that are thrown by PDO
14,846
protected static function preprocessQuery ( $ query , $ parameters = [ ] ) { if ( is_array ( $ parameters ) && count ( $ parameters ) ) { return vsprintf ( $ query , $ parameters ) ; } else { if ( isset ( $ parameters ) ) { return sprintf ( $ query , $ parameters ) ; } else { return $ query ; } } }
Formats a query with vsprintf if you pass an array and sprintf if you pass a string .
14,847
protected static function finishQueryLog ( & $ queryLog , $ result = false ) { if ( $ queryLog == false ) { return false ; } $ queryLog [ 'time_finish' ] = sprintf ( '%f' , microtime ( true ) ) ; $ queryLog [ 'time_duration_ms' ] = ( $ queryLog [ 'time_finish' ] - $ queryLog [ 'time_start' ] ) * 1000 ; if ( $ result ) ...
Uses the log array created by startQueryLog and sets time_finish on it as well as time_duration_ms
14,848
public static function serialize ( RequestInterface $ request ) : string { return self :: requestLine ( $ request ) . self :: headers ( $ request ) . $ request -> getBody ( ) ; }
Returns the string representation of an HTTP request .
14,849
public function getContent ( ) { return strtr ( $ this -> getRelationStubContent ( ) , [ '{{name}}' => $ this -> name , '{{relatedTable}}' => $ this -> relatedModel -> getTable ( ) , '{{relatedModel}}' => $ this -> relatedModel -> getClass ( ) , '{{foreignKey}}' => $ this -> foreignKey , ] ) ; }
Retourne le contenu de la relation .
14,850
protected function safeHandle ( Request $ request , Closure $ next , int $ limit , $ decay , bool $ global , bool $ headers ) { if ( $ this -> shouldPassThrough ( $ request ) ) { return $ next ( $ request ) ; } $ key = $ global ? sha1 ( $ request -> ip ( ) ) : $ request -> fingerprint ( ) ; if ( $ this -> limiter -> to...
Handle an incoming request with correct types .
14,851
public static function handleRequest ( ) { static :: $ calledClass = get_called_class ( ) ; if ( static :: peekPath ( ) == 'json' ) { static :: $ responseMode = static :: shiftPath ( ) ; if ( in_array ( static :: $ responseMode , [ 'json' , 'jsonp' ] ) ) { if ( ! static :: checkAPIAccess ( ) ) { return static :: throwA...
Start of routing for this controller . Methods in this execution path will always respond either as an error or a normal response . Responsible for detecting JSON or JSONP response modes .
14,852
public function addContentElementsCSS ( $ strBuffer = '' , $ objTemplate = null ) { foreach ( array ( 'CSS' , 'SCSS' , 'LESS' ) as $ strType ) { if ( $ GLOBALS [ 'TL_CTB_' . $ strType ] == '' ) { continue ; } $ strKey = substr ( md5 ( $ strType . $ GLOBALS [ 'TL_CTB_CSS' ] . $ GLOBALS [ 'TL_CTB_SCSS' ] . $ GLOBALS [ 'T...
Adds CSS created in content elements templates to the TL_USER_CSS global
14,853
public function addContentElementsJS ( $ strBuffer = '' , $ objTemplate = null ) { if ( $ GLOBALS [ 'TL_CTB_JS' ] == '' ) { return $ strBuffer ; } $ strKey = substr ( md5 ( 'js' . $ GLOBALS [ 'TL_CTB_JS' ] ) , 0 , 12 ) ; $ strPath = 'assets/js/' . $ strKey . '.js' ; if ( ! file_exists ( $ strPath ) ) { $ objFile = new ...
Adds Javascript created in content elements templates to the TL_JAVASCRIPT global
14,854
public function registerBlockElements ( ) { if ( isset ( $ GLOBALS [ 'TL_CTE' ] [ 'CTE' ] ) ) { return ; } $ db = \ Database :: getInstance ( ) ; if ( $ db -> tableExists ( "tl_elements" ) ) { $ arrElements = $ db -> prepare ( "SELECT * FROM tl_elements ORDER BY sorting ASC" ) -> execute ( ) -> fetchAllAssoc ( ) ; } if...
Adds the content elements from the database to the config array
14,855
public static function getRootPageId ( $ strTable , $ intId ) { if ( $ strTable == 'tl_article' ) { $ objArticle = \ ArticleModel :: findById ( $ intId ) ; if ( $ objArticle === null ) { return null ; } $ objPage = \ PageModel :: findWithDetails ( $ objArticle -> pid ) ; if ( $ objPage === null ) { return null ; } retu...
Resolve the rootpage ID from table and id
14,856
private static function addBackendCSS ( $ objLayout ) { $ arrCSS = \ StringUtil :: deserialize ( $ objLayout -> backendCSS ) ; if ( ! empty ( $ arrCSS ) && is_array ( $ arrCSS ) ) { if ( $ objLayout -> orderBackendCSS != '' ) { $ tmp = \ StringUtil :: deserialize ( $ objLayout -> orderBackendCSS ) ; if ( ! empty ( $ tm...
Adds the backend CSS of the layout to the backend template
14,857
private static function addBackendJS ( $ objLayout ) { $ arrJS = \ StringUtil :: deserialize ( $ objLayout -> backendJS ) ; if ( ! empty ( $ arrJS ) && is_array ( $ arrJS ) ) { if ( $ objLayout -> orderBackendJS != '' ) { $ tmp = \ StringUtil :: deserialize ( $ objLayout -> orderBackendJS ) ; if ( ! empty ( $ tmp ) && ...
Adds the backend Javascript of the layout to the backend template
14,858
public function onAfterExercise ( TestworkEvent \ AfterExerciseCompleted $ event ) { $ this -> timer -> stop ( ) ; $ this -> renderer -> render ( ) ; $ this -> printer -> write ( $ this -> renderer -> getResult ( ) ) ; }
Triggers after running tests .
14,859
public function search ( $ jql , $ startAt = null , $ maxResults = null , $ validateQuery = null , $ fields = null , $ expand = null ) { $ parameters = array ( 'jql' => $ jql , 'startAt' => $ startAt , 'maxResults' => $ maxResults , 'validateQuery' => $ validateQuery , 'fields' => $ fields , 'expand' => $ expand ) ; re...
Searches for issues using JQL
14,860
public function getProcessedResult ( ) { $ status = StepResult :: SKIPPED ; if ( ! empty ( static :: $ resultLabels [ $ this -> getResultCode ( ) ] ) ) { $ status = static :: $ resultLabels [ $ this -> getResultCode ( ) ] ; } return [ 'status' => $ status , 'error_message' => $ this -> getException ( ) , 'duration' => ...
Process result .
14,861
public function getFetcher ( $ alias ) { if ( ! is_string ( $ alias ) ) { throw new UnexpectedTypeException ( $ alias , 'string' ) ; } if ( ! isset ( $ this -> fetchers [ $ alias ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Could not load configuration fetcher "%s"' , $ alias ) ) ; } return $ this -> fetch...
Returns fetcher .
14,862
public function seeDateIsInDays ( $ date , $ days ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ days , $ this -> _GetNow ( ) -> diffInDays ( $ this -> _ParseDate ( $ date ) , false ) ) ; }
See date is in a given number of days .
14,863
public function dontSeeDateIsInDays ( $ date , $ days ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ days , $ this -> _GetNow ( ) -> diffInDays ( $ this -> _ParseDate ( $ date ) , false ) ) ; }
See date is not in a given number of days .
14,864
public function seeDateIsInMonths ( $ date , $ months ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ months , $ this -> _GetNow ( ) -> diffInMonths ( $ this -> _ParseDate ( $ date ) , false ) ) ; }
See date is in a given number of months .
14,865
public function dontSeeDateIsInMonths ( $ date , $ months ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ months , $ this -> _GetNow ( ) -> diffInMonths ( $ this -> _ParseDate ( $ date ) , false ) ) ; }
See date is not in a given number of months .
14,866
public function seeDateIsInYears ( $ date , $ years ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ years , $ this -> _GetNow ( ) -> diffInYears ( $ this -> _ParseDate ( $ date ) , false ) ) ; }
See date is in a given number of years .
14,867
public function dontSeeDateIsInYears ( $ date , $ years ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ years , $ this -> _GetNow ( ) -> diffInYears ( $ this -> _ParseDate ( $ date ) , false ) ) ; }
See date is in not a given number of years .
14,868
public function seeDateIsMonday ( $ date ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: MONDAY ) ; }
See date is a Monday .
14,869
public function dontSeeDateIsMonday ( $ date ) { \ PHPUnit_Framework_Assert :: assertFalse ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: MONDAY ) ; }
See date is not a Monday .
14,870
public function seeDateIsTuesday ( $ date ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: TUESDAY ) ; }
See date is a Tuesday .
14,871
public function dontSeeDateIsTuesday ( $ date ) { \ PHPUnit_Framework_Assert :: assertFalse ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: TUESDAY ) ; }
See date is not a Tuesday .
14,872
public function seeDateIsWednesday ( $ date ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: WEDNESDAY ) ; }
See date is a Wednesday .
14,873
public function dontSeeDateIsWednesday ( $ date ) { \ PHPUnit_Framework_Assert :: assertFalse ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: WEDNESDAY ) ; }
See date is not a Wednesday .
14,874
public function seeDateIsThursday ( $ date ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: THURSDAY ) ; }
See date is a Thursday .
14,875
public function dontSeeDateIsThursday ( $ date ) { \ PHPUnit_Framework_Assert :: assertFalse ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: THURSDAY ) ; }
See date is not a Thursday .
14,876
public function seeDateIsFriday ( $ date ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: FRIDAY ) ; }
See date is a Friday
14,877
public function dontSeeDateIsFriday ( $ date ) { \ PHPUnit_Framework_Assert :: assertFalse ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: FRIDAY ) ; }
See date is not a Friday .
14,878
public function seeDateIsSaturday ( $ date ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: SATURDAY ) ; }
See date is a Saturday .
14,879
public function dontSeeDateIsSaturday ( $ date ) { \ PHPUnit_Framework_Assert :: assertFalse ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: SATURDAY ) ; }
See date is not a Saturday .
14,880
public function seeDateIsSunday ( $ date ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: SUNDAY ) ; }
See date is a Sunday .
14,881
public function dontSeeDateIsSunday ( $ date ) { \ PHPUnit_Framework_Assert :: assertFalse ( $ this -> _ParseDate ( $ date ) -> dayOfWeek == Carbon :: SUNDAY ) ; }
See date is not a Sunday .
14,882
public function seeDateMatches ( $ d1 , $ d2 ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ d1 ) -> eq ( $ this -> _ParseDate ( $ d2 ) ) ) ; }
See that two dates match .
14,883
public function dontSeeDateMatches ( $ d1 , $ d2 ) { \ PHPUnit_Framework_Assert :: assertTrue ( $ this -> _ParseDate ( $ d1 ) -> ne ( $ this -> _ParseDate ( $ d2 ) ) ) ; }
See that two dates don t match .
14,884
public function seeDateInQuarter ( $ date , $ quarter ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ quarter , $ this -> _ParseDate ( $ date ) -> quarter ) ; }
See the date is within a particular quarter of the year .
14,885
public function dontSeeDateInQuarter ( $ date , $ quarter ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ quarter , $ this -> _ParseDate ( $ date ) -> quarter ) ; }
See the date is not within a particular quarter of the year .
14,886
public function seeDayInWeek ( $ date , $ day ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ day , $ this -> _ParseDate ( $ date ) -> dayOfWeek ) ; }
See the date is a given day in the week .
14,887
public function dontSeeDayInWeek ( $ date , $ day ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ day , $ this -> _ParseDate ( $ date ) -> dayOfWeek ) ; }
See the date is not a given day in the week .
14,888
public function seeDayInMonth ( $ date , $ day ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ day , $ this -> _ParseDate ( $ date ) -> day ) ; }
See the date is a given day in the month .
14,889
public function dontSeeDayInMonth ( $ date , $ day ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ day , $ this -> _ParseDate ( $ date ) -> day ) ; }
See the date is not a given day in the month .
14,890
public function seeDayInYear ( $ date , $ day ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ day , $ this -> _ParseDate ( $ date ) -> dayOfYear ) ; }
See the date is a given day in the year .
14,891
public function dontSeeDayInYear ( $ date , $ day ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ day , $ this -> _ParseDate ( $ date ) -> dayOfYear ) ; }
See the date is not a given day in the year .
14,892
public function seeWeekInYear ( $ date , $ week ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ week , $ this -> _ParseDate ( $ date ) -> weekOfYear ) ; }
See the date is a given week in the year .
14,893
public function dontSeeWeekInYear ( $ date , $ week ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ week , $ this -> _ParseDate ( $ date ) -> weekOfYear ) ; }
See the date is not a given week in the year .
14,894
public function seeMonthInYear ( $ date , $ month ) { \ PHPUnit_Framework_Assert :: assertEquals ( $ month , $ this -> _ParseDate ( $ date ) -> month ) ; }
See the month in the year is a given value .
14,895
public function dontSeeMonthInYear ( $ date , $ month ) { \ PHPUnit_Framework_Assert :: assertNotEquals ( $ month , $ this -> _ParseDate ( $ date ) -> month ) ; }
See the month in the year is not a given value .
14,896
public function getSubject ( ) { if ( ! $ this -> isNewRecord && $ this -> subject === null ) { $ this -> subject = call_user_func ( [ $ this -> model_class , 'findOne' ] , $ this -> foreign_pk ) ; if ( $ this -> subject === null ) { $ msg = Yii :: t ( 'app' , 'Could not find model for attachment `{attachment}`' , [ 'a...
Getter for the subject model
14,897
public function setSubject ( $ subject ) { self :: validateSubject ( $ subject , true ) ; $ this -> model_class = $ subject -> className ( ) ; $ this -> foreign_pk = $ subject -> getPrimaryKey ( true ) ; $ this -> subject = $ subject ; }
Sets the subject - model for this comment
14,898
public static function validateSubject ( $ subject , $ throwException = true ) { if ( ! ComponentConfig :: isActiveRecord ( $ subject , $ throwException ) ) return false ; if ( ! ComponentConfig :: hasBehavior ( $ subject , CommentsBehavior :: className ( ) , $ throwException ) ) return false ; if ( empty ( $ subject -...
Validates if the model is an active record has the comments behavior has a primary key and is not a new record .
14,899
public function update ( ) { $ t = new Template ; $ t -> name = $ this -> getTemplateName ( ) ; $ fg = new Fieldgroup ; $ fg -> name = $ this -> getTemplateName ( ) ; foreach ( $ this -> fields as $ field ) { if ( ! ( $ field -> flags & Field :: flagGlobal ) ) continue ; $ fg -> add ( $ field ) ; } $ fg -> save ( ) ; $...
Create a template Add a fieldgroup with the title field