Sets the data source as a collection of objects.

@param IObjectSet $objects

@return ObjectTableDefiner
196093
public function fromObjects(IObjectSet $objects) : ObjectTableDefiner
    {
        return new ObjectTableDefiner($this->name, $this->callback, $objects);
    }
302887
public function setModels(array $models): ModelCollectionInterface
    {
        foreach ($this->models as $model) {
            $this->removeModel($model);
        }
        foreach ($models as $model) {
            $this->addModel($model);
        }

        return $this;
    }
1177519
public function persist($object, $collection = null)
    {
        $repository = $this->getRepository(get_class($object), $collection);
        $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_PRE_PERSIST, $object);
        $this->addObject($object, ObjectManager::OBJ_NEW, $repository);
        $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_POST_PERSIST, $object);

        return $this;
    }
61879
public function entitiesFrom(IEntitySet $entities) : ObjectArrayFieldBuilder
    {
        return (new ObjectArrayFieldBuilder($this
            ->type(new ArrayOfObjectIdsType(
                $entities,
                Field::element()->entityFrom($entities)->required()->build(),
                $loadAsObjects = true
            ))
        ))->containsNoDuplicates();
    }
1155647
public function from(IObjectMapper $mapper)
    {
        $this->mapper     = $mapper;
        $this->definition = $mapper->getDefinition();
        $this->relations  = $this->definition->getPropertyRelationMap();

        if ($mapper instanceof IEntityMapper) {
            foreach ($mapper->getPrimaryTable()->getColumns() as $column) {
                $this->readDefinition->addColumn($column);
            }
        }

        $this->validProperties = $this->definition->getPropertyColumnMap() + $this->relations;
    }
837681
public function setSource($model, $table = null)
    {
        if (!$table) {
            $table = $model->table;
        }

        if (@!$this->app->mongoclient) {
            $m = new MongoClient($this->app->getConfig('mongo/url', null));
            $db = $this->app->getConfig('mongo/db');
            $this->app->mongoclient = $m->$db;
        }

        parent::setSource($model, array(
            'db' => $this->app->mongoclient->$table,
            'conditions' => array(),
            'collection' => $table,
        ));

        $model->addMethod('incr,decr', $this);

        //$model->data=$model->_table[$this->short_name]['db']->get($id);
    }
823362
public function setByObject(stdClass $object)
    {
        $vars = get_object_vars($object);

        if (is_array($vars)) {
            foreach ($vars as $property => $value) {
                $this->$property = $value;
            }
        }

        return $this;
    }
552931
private function getObjectClass(ICollection $collection, IObjectType $objectType)
    {
        if (null != ($objectClass = $objectType->getObjectClass())) {
            return $objectClass;
        } elseif ($collection instanceof IHierarchicCollection || $collection instanceof ICommonHierarchy) {
            return $this->defaultHierarchicObjectClass;
        } else {
            return $this->defaultObjectClass;
        }
    }
661343
public function setObjects(array $objects)
    {
        $this->objects = $objects;
        $this->objects[ObjectManagerInterface::class]['i'] = $this;
        $this->objects[get_class($this)]['i'] = $this;
    }
1052163
public function setObjectName($name)
    {
        if (!is_null($name)) {
            $name = (string) $name;
        }

        $this->objectName = $name;
        return $this;
    }
955174
public function fromArray($objects)
    {
        $this->clear();
        foreach ($objects as $objectData) {
            $this->add($objectData);
        }
    }
867940
public function setDataSource($dataSource)
    {
        if (!$dataSource instanceof DataSourceInterface) {
            $dataSource = $this->getServiceLocator()->get('DataGrid\Factory\DataSource')->get($dataSource);
        }
        $this->dataSource = $dataSource;
        return $this;
    }
1067730
protected function findSupportingModelFactoryForObjects($objects)
    {
        foreach ($this->modelFactories as $modelFactory) {
            if ($modelFactory->supportsObjects($objects)) {
                return $modelFactory;
            }
        }
    }
1142914
public function setObject($object, $method  = null)
    {
        if (! is_object($object)) {
            throw new Exception('not object');
        }
        $ref = new \ReflectionObject($object);
        $file = $ref->getFileName();
        $this->setPath($file);

        return $this;
    }
239327
function setData($object, array $data)
    {
        if (! $this->has($object) )
            throw new \Exception('Object Not Found.');

        if ($data == array_values($data))
            throw new \InvalidArgumentException('Data tags must be associative array.');


        $hash = $this->genETag($object);
        $this->_objs[$hash]['data'] = $data;
        return $this;
    }
1091420
private function setObjectForObjectData(string $identifierAttribute, array $data)
    {
        $configurationObject = $this->configuration
            ->getConfigurationObjectForIdentifier($data[$identifierAttribute]);
        $className = $configurationObject->getClassName();
        $fqdnClass = $className->getValue();
        $object = new $fqdnClass();

        foreach ($data as $attribute => $value) {
            if ($attribute === $identifierAttribute) {
                continue;
            }

            $type = $configurationObject->getTypeForAttribute($attribute);
            $this->processDeserializeForType($type, $object, $value);
        }

        return $object;
    }
120715
private function addObjects($objects, &$container)
    {
        if (!is_array($objects))
        {
            $objects = [$objects];
        }
        foreach ($objects as $object)
        {
            if ($object->getObjectId() == null)
            {
                $container['null'][] = $object;
            } else
            {
                $container[$object->getObjectID()] = $object;
            }
        }
    }