Пример #1
0
 /**
  * Creates a new Schema or Database
  * @param  string $flat Flat name
  * @return mixed
  * @throws FlatAlreadyExistsException
  */
 public function build($flat)
 {
     // validate is not prohibited
     if (in_array($flat, $this->reserved)) {
         return new FlatReservedException();
     }
     // validate it doesn't exists
     if ($this->exists($flat)) {
         throw new FlatAlreadyExistsException();
     }
     // create the Flat
     return $this->schema->create($flat);
 }