original_string: public function lessThanOrEqual($field, $value, $message = null, $when = null)
      {
          $extra = array_filter(['on' => $when, 'message' => $message]);
  
          return $this->add($field, 'lessThanOrEqual', $extra + [
              'rule' => ['comparison', Validation::COMPARE_LESS_OR_EQUAL, $value]
          ]);
      }
code: public function lessThanOrEqual($field, $value, $message = null, $when = null)
      {
          $extra = array_filter(['on' => $when, 'message' => $message]);
  
          return $this->add($field, 'lessThanOrEqual', $extra + [
              'rule' => ['comparison', Validation::COMPARE_LESS_OR_EQUAL, $value]
          ]);
      }
code_tokens: public function lessThanOrEqual ( $ field , $ value , $ message = null , $ when = null ) { $ extra = array_filter ( [ 'on' => $ when , 'message' => $ message ] ) ; return $ this -> add ( $ field , 'lessThanOrEqual' , $ extra + [ 'rule' => [ 'comparison' , Validation :: COMPARE_LESS_OR_EQUAL , $ value ] ] ) ; }
docstring: Add a less than or equal comparison rule to a field.
  
  @param string $field The field you want to apply the rule to.
  @param int|float $value The value user data must be less than or equal to.
  @param string|null $message The error message when the rule fails.
  @param string|callable|null $when Either 'create' or 'update' or a callable that returns
  true when the validation rule should be applied.
  @see \Cake\Validation\Validation::comparison()
  @return $this
docstring_tokens: Add a less than or equal comparison rule to a field .