protected function fromInt($value) { if ($value < 0) { throw new InvalidValueException('UInt : negative values forbidden'); } parent::fromInt($value); }
public function prepValueForDB($value) { $value = parent::prepValueForDB($value); $ciphertext = $this->service->encrypt($value); $this->value = $ciphertext; return $ciphertext; }
public function setValue($value, $record = null, $markChanged = true) { if ($record instanceof DataObject) { $this->object = $record; } parent::setValue($value, $record, $markChanged); }
/** * @param string $name * @param DataOject $object The object that this is primary key for (should have a relation with $name) */ public function __construct($name = null, $object) { $this->object = $object; parent::__construct($name); }
function __construct($name, $object = null) { $this->object = $object; parent::__construct($name); }
/** * Boolean to integer conversion * @return Int */ public final function toInt() { $int = null; Int::create($int, $this); return $int; }
/** * * @param int $val */ public function removeFlag($val) { Int::create($val); $this->setValue($val->bw_not()->bw_and($this)); }
/** * @dataProvider provideTestFilter */ public function testFilter($options, $raw, $filtered, $valid) { $int = new Int($options); $this->assertEquals($filtered, $int->filter($raw)); $this->assertEquals($valid, $int->validate($raw)); }
public function add($val) { $add = new Int($val); $this->val += $add->get(); return $this; }