@param array $attributes

@return bool
967188
public function create(array $attributes): bool
    {
        $model = $this->getModel();
        $model->setAttributes($attributes);

        return $model->save();
    }
414174
public function isValid(array $attributes = [])
    {
        try {
            if (!isset($attributes['validator'])) {
                return false;
            }
            $reflection = new ReflectionClass($attributes['validator']);

            if (!$reflection->hasMethod('__invoke')) {
                return false;
            }
            if (!in_array('Antares\Tester\Contracts\Tester', $reflection->getInterfaceNames())) {
                return false;
            }
        } catch (\Exception $e) {
            Log::emergency($e);
            return false;
        }
        return true;
    }
1082781
protected function prepareAttributes(array $attributes)
    {
        foreach ($attributes as $key => $attribute) {
            if (in_array($key, $this->getDates()) && ! is_null($attribute)) {
                $attribute = $this->asDateTime($attribute);
            }
            if ($attribute instanceof DateTime) {
                $attribute = $this->fromDateTime($attribute);
            }
            $attributes[$key] = (string) $attribute;
        }
        return $attributes;
    }
6947
protected function callClosureAttributes(array $attributes)
    {
        foreach ($attributes as &$attribute) {
            $attribute = $attribute instanceof Closure
                ? $attribute($attributes) : $attribute;
        }

        return $attributes;
    }
339819
public function setTableAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->tableAttributes[$attribute] = $value;
        }

        return $this;
    }
798718
public function updateOrInsert(array $attributes, array $values = [])
	{
		if (! $this->where($attributes)->exists()) {
			return $this->insert(array_merge($attributes, $values));
		}

		return (bool) $this->limit(1)->update($values);
	}
1318864
public function save($attributes = [])
    {
        $attributes = (empty($attributes) || is_null($attributes)) ? $this->getAttributes() : $attributes;

        return $this->_save($attributes);
    }
999328
public function validate(array $attributes): bool
    {
        $rules = $this->getScenarios();

        foreach ($rules as $rule) {
            $names = array_map('trim', explode(',', $rule[0]));
            array_walk($names, function ($name) use ($attributes, $rule) {
                $this->validateValue($attributes, $name, $rule);
            });
            unset($names);
        }

        unset($rules);

        return count($this->errors) === 0;
    }
822203
public function validate(array $attributes)
    {
        $table     = $this->model->getTable();
        $locale    = array_get($attributes, 'locale', '');
        $namespace = array_get($attributes, 'namespace', '');
        $group     = array_get($attributes, 'group', '');
        $rules     = [
            'locale'    => 'required',
            'namespace' => 'required',
            'group'     => 'required',
            'item'      => "required|unique:{$table},item,NULL,id,locale,{$locale},namespace,{$namespace},group,{$group}",
            'text'      => '', // Translations may be empty
        ];
        $validator = $this->app['validator']->make($attributes, $rules);
        if ($validator->fails()) {
            $this->errors = $validator->errors();
            return false;
        }
        return true;
    }
749250
public function setLinkAttributes($attributes)
    {
        if (! is_array($attributes)) {
            $attributes = [$attributes];
        }

        $this->link_attributes = $attributes;

        return $this;
    }
1092179
public function attributes($attributes)
    {
        if (is_array($this->attributes) and is_array($attributes)) {
            $attributes = array_merge($this->attributes, $attributes);
        }
        $this->attributes = $attributes;

        return $this;
    }
48022
protected function selectAttributes($attributes = ['*'])
    {
        $attributes = $attributes ?: ['*'];

        if ($attributes == ['*'] && $this->attributes != ['*']) {
            $attributes = $this->attributes;
        }

        return $attributes;
    }
1244115
public function group(array $attributes = [])
    {
        $model = $this->schema->groupModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), [
                $this->schema->top(),
                $this->schema->objectCategoryGroup(),
            ]);
    }
1147987
public static function fromArray(array $attributes) {
		unset($attributes['id']);
		
		$attributesObject = new self();
		
		foreach ($attributes as $key => $value) {
			$attributesObject->add($key, $value);
		}
		
		return $attributesObject;
	}
120575
public function has_mapping( $attributes = null ) {
		$mapping = $this->get_mapping();

		if ( is_null( $attributes ) ) {
			return count( $mapping ) > 0;
		}

		$attributes = is_array( $attributes ) ? $attributes : func_get_args();
		foreach ( $attributes as $attribute ) {
			if ( array_key_exists( $attribute, $mapping ) ) {
				return true;
			}
		}

		return false;
	}
123082
private function supportsAnyAttribute($attributes)
    {
        foreach ($attributes as $attribute) {
            if ($this->supportsAttribute($attribute)) {
                return true;
            }
        }

        return false;
    }
1100746
private function sanitizeAttributes(array $attributes)
    {
        $sanitizeAttributes = [];
        foreach ($attributes as $key => $value) {
            $key = $this->formatAttribute($key);
            if (isset($sanitizeAttributes[$key])) {
                if (!is_array($sanitizeAttributes[$key])) {
                    $sanitizeAttributes[$key] = [$sanitizeAttributes[$key]];
                }

                if (!is_array($value)) {
                    $value = [$value];
                }

                $value = $sanitizeAttributes[$key] + $value;
            }

            $sanitizeAttributes[$key] = $value;
        }

        return $sanitizeAttributes;
    }