Beispiel #1
0
 /**
  * @param RepositoryContainer $orm
  * @param Subject[] $subjects
  * @param Video[] $videos
  */
 protected function createSchemasAndBlocks($orm, $subjects, $videos)
 {
     $author = $orm->users->getById(1);
     foreach ($subjects as $subject) {
         for ($i = 0; $i < 3; ++$i) {
             $schema = new Schema();
             $schema->name = $this->faker->name;
             $schema->subject = $subject;
             $schema->author = $author;
             $orm->schemas->attach($schema);
             for ($k = 0; $k < 10; ++$k) {
                 $block = new Block();
                 $block->name = $this->faker->name;
                 $block->author = $author;
                 $orm->blocks->attach($block);
                 $bridge = new BlockSchemaBridge();
                 $bridge->position = $k;
                 $bridge->block = $block;
                 $bridge->schema = $schema;
                 $orm->blockSchemaBridges->attach($bridge);
                 for ($l = 0; $l < 7; ++$l) {
                     $bridge = new ContentBlockBridge();
                     $bridge->block = $block;
                     $bridge->content = $this->faker->randomElement($videos);
                     $bridge->position = $l;
                     $orm->contentBlockBridges->attach($bridge);
                 }
             }
         }
     }
 }
 public function email($first, $last)
 {
     if ($this->numberBetween(0, 100) > 90) {
         return Strings::webalize($first) . '@' . Strings::webalize($last) . '.' . $this->randomElement(['cz', 'cz', 'cz', 'cz', 'cz', 'cz', 'com', 'com', 'com', 'pro', 'name', 'info', 'net', 'org']);
     } else {
         return Strings::webalize("{$first}.{$last}", '.') . '@' . Internet::freeEmailDomain();
     }
 }