Example #1
0
 /**
  * Constructor
  *
  * @param integer $productId Product identificator OPTIONAL
  *
  * @return void
  */
 public function __construct($productId = null)
 {
     parent::__construct();
     if (isset($productId)) {
         $this->productId = intval($productId);
     }
 }
Example #2
0
 /**
  * Constructor
  *
  * @param mixed $fieldClass Field class OPTIONAL
  * @param mixed $fieldName  Field identifier OPTIONAL
  * @param mixed $fieldValue Field value OPTIONAL
  *
  * @return void
  */
 public function __construct($fieldClass = null, $fieldName = null, $fieldValue = null)
 {
     parent::__construct();
     if (isset($fieldClass)) {
         $this->fieldClass = $fieldClass;
     }
     if (isset($fieldName)) {
         $this->fieldName = $fieldName;
     }
     if (isset($fieldValue)) {
         $this->fieldValue = $fieldValue;
     }
 }
Example #3
0
 /**
  * Sanitaize
  *
  * @param mixed $data Daa
  *
  * @return array
  */
 public function sanitize($data)
 {
     return $this->find($data) ? array($this->name => $this->validator->sanitize($data[$this->name])) : array($this->name => $this->defaultValue);
 }
Example #4
0
 /**
  * Constructor
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->pairs = new \Doctrine\Common\Collections\ArrayCollection();
 }
Example #5
0
 /**
  * Constructor
  *
  * @param boolean $nonEmpty Non-empty flag OPTIONAL
  *
  * @return void
  */
 public function __construct($nonEmpty = false)
 {
     parent::__construct();
     $this->markAsNonEmpty($nonEmpty);
 }
Example #6
0
 /**
  * Constructor
  *
  * @param string $mode Validation mode OPTIONAL
  *
  * @return void
  */
 public function __construct($mode = self::STRICT)
 {
     parent::__construct();
     $this->mode = $mode;
 }