Generates a new table row

@param array $attributes

@return Row
482896
public function row(array $attributes = array())
        {
            $row = new self();

            if (count($attributes)) {
                $row->setAttributes($attributes);
            }

            return $row;
        }
1047208
public static function fromArray(array $attributes)
    {
        $options = array_get($attributes, 'options', []);

        return new self($attributes['id'], $attributes['name'], $attributes['price'], $options);
    }
372964
public function container(array $attributes = [])
    {
        $model = $this->schema->containerModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), $this->schema->objectClassContainer());
    }
351630
public function create(array $attributes = null)
    {
        $this->doQuery($this->createQuery($attributes));
        $this->{static::$PKFieldName[0]} = static::db()->lastInsertId();
        if ($attributes) {
            $this->fillProperties($attributes);
        }

        return $this;
    }
393689
public function firstOrNew(array $attributes)
    {
        if (is_null($instance = $this->where($attributes)->first())) {
            $instance = $this->related->newInstance($attributes);

            $instance->setAttribute($this->getForeignKeyName(), $this->getParentKey());
        }

        return $instance;
    }
1246153
public function create(array $attributes = [])
    {
        // Create a new instance
        $instance = $this->createModel();

        // Fill instance with data
        $instance->fill($attributes);

        // Save the instance
        $created = $instance->save();

        // Fire the created event
        $this->getContainer('events')->fire($this->getRepositoryId().'.entity.created', [$this, $instance]);

        // Return instance
        return [
            $created,
            $instance,
        ];
    }
848274
public function withAttributes(array $attributes)
    {
        $clone = clone $this;

        foreach ($attributes as $name => $value) {
            $clone->dom->documentElement->setAttribute($name, $value);
        }

        return $clone;
    }
560238
public function newModelInstance($attributes = [])
    {
        return $this->model->newInstance($attributes)->setConnection(
            $this->query->getConnection()
        );
    }
63447
public function newFromBuilder($attributes = array())
    {
        $m = $this->mapData((array) $attributes)->newInstance(array(), true);
        $m->setRawAttributes((array) $attributes, true);
        return $m;
    }
336285
public static function insertIgnore(array $attributes = [])
    {
        $model = new static();
        $driver = $model->GetConnection()->GetDriverName();
        switch ($driver) {
            case 'sqlite':
                return static::executeQuery('insert or ignore', $attributes);
                break;
            default:
                return static::executeQuery('insert ignore', $attributes);
                break;
        }
    }
17776
public static function fromArray(array $attributes)
    {
        return new self(
            $attributes['id'],
            $attributes['name'],
            $attributes['price'],
            $attributes['quantity'],
            Arr::get($attributes, 'options', [])
        );
    }
952796
public function toArray(array $attributes = array())
	{
		$data = parent::toArray();

		if(count($attributes) == 0)
			return $data;

		$new = array();

		foreach($attributes as $attribute)
			$new[$attribute] = $data[$attribute];

		return $new;
	}
628301
public function computer(array $attributes = [])
    {
        $model = $this->schema->computerModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), [
                $this->schema->top(),
                $this->schema->person(),
                $this->schema->organizationalPerson(),
                $this->schema->user(),
                $this->schema->computer(),
            ]);
    }
1333371
public function createTextarea(array $attributes = [])
    {
        $this->childNodes->push(new Form\Elements\Textarea($attributes));

        return $this->childNodes->last();
    }
788330
public static function make($attributes = [])
    {
        $jobset = new static();

        // make jobset model
        $model = $jobset->makeModel($attributes);
        // update local model
        $jobset->setModel($model);
        // make job models and init job instances
        $jobset->makeJobs();
        // set jobset try at
        $jobsetTryAt = $jobset->getJobsEarliestTryAt();
        $jobset->model->setTryAt($jobsetTryAt);
        $jobset->model->persist();

        return $jobset;
    }
1122365
public function firstOrCreate(array $attributes = [])
    {
        $model = $this->first();
        if (!$model) {
            $model = $this->create($attributes);
        }
        return $model;
    }
1162461
protected function fillableFromArray(array $attributes)
    {
        if (! empty($attributes) && property_exists($this, 'defaults')) {
            $attributes = array_diff_assoc($attributes, $this->defaults);
        }

        return parent::fillableFromArray($attributes);
    }