Exemplo n.º 1
0
 public function __construct($id, $playlistId, $title, $url)
 {
     $validate = new \other\ValidationHandler();
     try {
         $this->id = $id;
         $this->playlistId = $playlistId;
         $this->title = $title;
         $this->url = $url;
         $validate->validateLength($this->title, 3, 50);
         $validate->validateWithRegex($this->title, "/[^-a-z0-9_ ]/i");
     } catch (Exception $e) {
         echo $e;
     }
 }
Exemplo n.º 2
0
 public function __construct($title)
 {
     $validate = new \other\ValidationHandler();
     try {
         $this->id = 0;
         $this->title = $title;
         $this->tracks = array();
         $validate->validateLength($this->title, 3, 50);
         $validate->validateWithRegex($this->title, "/[^-a-z0-9_ ]/i");
         // $this->DAL = new \dal\PlaylistDAL();
         $this->trackDAL = new \dal\TrackDAL();
     } catch (Exception $e) {
         echo $e;
     }
 }