Beispiel #1
0
 /**
  * @param  boolean $value
  * @param  string  $field
  * @return boolean
  */
 protected function validateIsBoolean($value, $field)
 {
     $boolean = new Boolean($value);
     $value = $boolean->getValue();
     $booleanValidator = new BooleanValidator();
     if (!$booleanValidator->isValid($value)) {
         $messages = array_values($booleanValidator->getMessages());
         $this->addError(new Error($field, $value, $messages));
         return false;
     }
     return true;
 }
Beispiel #2
0
 /**
  * @param boolean $boolean
  */
 public function setSuperuser($boolean)
 {
     $boolean = new Boolean($boolean);
     $this->superuser = $boolean->getValue(Boolean::STRICT_VALUE);
 }
Beispiel #3
0
 /**
  * @return boolean
  */
 public function getSendregistermail()
 {
     $sendregistermailBoolean = new Boolean($this->sendregistermail);
     return $sendregistermailBoolean->getValue(Boolean::DOCTRINE_VALUE);
 }
Beispiel #4
0
 /**
  * @param mixed $allRights
  */
 public function setAllRights($allRights)
 {
     $boolean = new Boolean($allRights);
     $this->allRights = $boolean->getValue();
 }
Beispiel #5
0
 /**
  * @return boolean
  */
 public function getIsDeletable()
 {
     if (is_null($this->isdeletable)) {
         return null;
     }
     $deletableBoolean = new Boolean($this->isdeletable);
     return $deletableBoolean->getValue(Boolean::DOCTRINE_VALUE);
 }
Beispiel #6
0
 /**
  * @test
  * @group library
  * @dataProvider nonBooleanValuesProvider
  */
 public function getValueShouldReturnAStrictFalseForNonBooleanValues($value)
 {
     $boolean = new Boolean($value);
     $this->assertSame(false, $boolean->getValue());
 }
Beispiel #7
0
 /**
  * @param bool
  */
 public function setReadonly($readonly)
 {
     $boolean = new Boolean($readonly);
     $this->readonly = $boolean->getValue(Boolean::STRICT_VALUE);
 }