GetOptionKit\OptionResult::create PHP Method

create() public static method

public static create ( $specs, array $values = [], array $arguments = null )
$values array
$arguments array
    public static function create($specs, array $values = array(), array $arguments = null)
    {
        $new = new self();
        foreach ($specs as $spec) {
            $id = $spec->getId();
            if (isset($values[$id])) {
                $new->{$id} = $spec;
                $spec->setValue($values[$id]);
            }
            if ($arguments) {
                foreach ($arguments as $arg) {
                    $new->addArgument(new Argument($arg));
                }
            }
        }
        return $new;
    }

Usage Example

Ejemplo n.º 1
0
 public function testRemoveColumn()
 {
     $schema = new AuthorSchema();
     $schema->column('cellphone')->varchar(30);
     $this->buildSchemaTables([$schema], true);
     AutomaticMigration::options($options = new OptionCollection());
     $migrate = new AutomaticMigration($this->conn, $this->queryDriver, $this->logger, OptionResult::create($options, []));
     $migrate->upgrade([$schema]);
 }
All Usage Examples Of GetOptionKit\OptionResult::create