Find all entities.

@param array $attributes

@return \Illuminate\Support\Collection
14760
public function findAll($attributes = ['*'])
    {
        return $this->executeCallback(get_called_class(), __FUNCTION__, func_get_args(), function () use ($attributes) {
            return $this->prepareQuery($this->createModel())->get($attributes);
        });
    }
538652
public function attributes(array $attributes)
        {
            $this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));

            return $this;
        }
128585
public function store(array $attributes)
    {
        $model = $this->parent->store($attributes);
        $this->cache->put($model);
        return $model;
    }
803799
public function set(array $attributes)
    {
        collect($attributes)->each(function ($value, $key) {
            $this->setKeyValue($key, $value);
        });

        // If we were working with eagerly-loaded relation,
        // we need to reload its data to be sure that we
        // are working only with the actual settings.

        if ($this->resource->relationLoaded('propertyBag')) {
            $this->resource->load('propertyBag');
        }

        return $this->sync();
    }
533907
public function ou(array $attributes = [])
    {
        $model = $this->schema->organizationalUnitModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), [
                $this->schema->top(),
                $this->schema->organizationalUnit(),
            ]);
    }
597109
protected function getBatchesForAttributes(array $attributes)
    {
        $batches = [];

        $lcAttributes = array_map('strtolower', $attributes);
        foreach ($this->batches as $index => $batch) {
            /** @var Batch $batch */
            if (in_array(strtolower($batch->getAttribute()), $lcAttributes)) {
                $batches[$index] = $batch;
            }
        }

        return $batches;
    }
497279
public function user(array $attributes = [])
    {
        $model = $this->schema->userModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), $this->schema->userObjectClasses());
    }
614510
public function findAll()
    {
        $keys = $this->getFileManager()->keys();
        $entities = array();
        if(is_array($keys)) {
            foreach($keys as $key) {
                if(preg_match('/^'.$this->getHash().'/', $key)) {
                    $entities[] = $this->loadEntity($key);
                }
            }
        }
        
        return $entities;
    }
766140
public function find($id, $attributes = ['*'])
    {
        return $this->executeCallback(get_called_class(), __FUNCTION__, func_get_args(), function () use ($id, $attributes) {
            return $this->prepareQuery($this->createModel())->find($id, $attributes);
        });
    }
336033
public static function findAllByAttributes($attributes, $condition = null, $params = [])
    {
        $class = get_called_class();
        $condition = ModelCondition::getFrom($condition, $class);
        foreach ($attributes as $name => $value) {
            $condition->compareColumn($name, $value);
        }
        return self::findAll($condition, $params);
    }
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;
    }
460056
public function collectData($attributes = null)
    {
        $data = [];
        foreach ($this->models as $model) {
            if ($this->dataCollector instanceof Closure) {
                list($key, $row) = call_user_func($this->dataCollector, $model, $this);
            } else {
                $key = $model->getPrimaryKey();
                $row = $model->getAttributes($attributes);
            }

            if ($key) {
                $data[$key] = $row;
            } else {
                $data[] = $row;
            }
        }

        return $data;
    }
768151
public function fill(array $attributes = [])
    {
        foreach ($attributes as $property => $value) {
            if (isset(static::$propertyMap[static::class][$property])) {
                $this->{$property} = $value;
                continue;
            }

            if (isset(static::$setterMap[static::class][$property])) {
                $this->__set($property, $value);
                continue;
            }

            if (!isset(static::$aliases[static::class][$property])) {
                $this->constraints->__set($property, $value);
                continue;
            }

            $alias = static::$aliases[static::class][$property];

            if ($alias instanceof Closure) {
                $alias($this, $property, $value);
                continue;
            }

            if (property_exists($this, $alias)) {
                $this->{$alias} = $value;
                continue;
            }

            // Because constraints needs to be removed on
            // false values, they can only be aliased with
            // closures (callables) so this line is only
            // included to document that
            // $this->__set($alias, $value);
        }

        return $this;
    }
606872
public function store($attributes = [])
    {
        // Set the attributes
        $attributes = (!empty($attributes))? $attributes : $this->app->request->input();

        // Create the record
        $result = $this->model->create($attributes);

        // Return results
        return [
            'success' => true,
            'id' => $result['id'],
            'data' => $result
        ];
    }
54030
private function extractKeys($attributes, $keys)
    {
        if (!$keys) {
            $keys = array_keys($attributes);
        }

        if (!is_array($keys)) {
            $keys = (array) $keys;

            return $keys;
        }

        return $keys;
    }
957193
protected static function firstByAttributes($attributes)
	{
		$query = static::query();

		foreach ($attributes as $key => $value)
		{
			$query->where($key, $value);
		}

		return $query->first() ?: null;
	}
1195027
protected function contains(array $attributes = array())
    {
        $collection = $this->findAll();
        $filtered   = $collection->filter(function($value, $key) use($attributes) {
            foreach ($attributes as $keyname => $attrVal) {
                if ($value->{$keyname} != $attrVal) {
                    return false;
                }
            }
            return true;
        });
        return $filtered->count() > 0;
    }