fill() public method

Fills the tablename with fake value.
public fill ( ) : array
return array
Ejemplo n.º 1
0
 /**
  * Fills the given table with fake data.
  *
  * @param string|null $tableName
  *
  * @return array $rows
  * @throws \Fakerino\FakeData\Exception\MissingRequiredOptionException
  */
 public function fakeTable($tableName = null)
 {
     if ($tableName === null) {
         throw new MissingRequiredOptionException('table name');
     }
     $connectionParams = FakerinoConf::get('database');
     $dbFiller = new DbFiller($connectionParams, $this->db, $tableName, $this, $this->num);
     $rows = $dbFiller->fill();
     return $rows;
 }
Ejemplo n.º 2
0
 /**
  * Fills the given table with fake data.
  *
  * @param string|null $tableName
  *
  * @return array $rows
  * @throws \Fakerino\FakeData\Exception\MissingRequiredOptionException
  */
 public function fakeTable($tableName = null)
 {
     if (null === $tableName) {
         throw new MissingRequiredOptionException('table name');
     }
     $dbFiller = new DbFiller($this->db, $tableName, $this, $this->num);
     $rows = $dbFiller->fill();
     return $rows;
 }