insert properties into memory

@param Fluent $field
518339
protected function memorize(Fluent $field)
    {
        if (!isset($field->attributes['executor'])) {
            return false;
        }
        $component  = $this->extractor->extractForm($field->attributes['executor']);
        $attributes = array_merge($component, ['name' => $field->get('name')], $field->attributes);

        $memory = app('antares.memory')->make('tests');
        $memory->put($attributes['title'], $attributes);
        $memory->finish();
    }
470149
private function insert($object)
    {
        //TODO: this should only be done if there is a Delete query pending for the same entity table
        $this->manager->commit();

        $query = $this->manager
            ->getDriver()
            ->getQueryBuilder()
            ->insert($this->getTable());

        $query->values(
            $query->createPositionalParameter(
                array_filter(
                    $this->toArray($object),
                    [Utils::class, 'notNull']
                )
            )
        );

        return $this->setFieldValue(
            $object,
            $this->getPrimaryKey(),
            $query->query()
        );
    }
225178
private void processSimpleField(Field child) {
    PropertyMetadata propertyMetadata = IntrospectionUtils.getPropertyMetadata(child);
    if (propertyMetadata != null) {
      // Process override
      processPropertyOverride(propertyMetadata);
      metadata.putPropertyMetadata(propertyMetadata);
    }
  }
75444
protected function addField(Field $field)
    {
        if ($this->hasField($field->getName())) {
            throw new \Exception(
                'Field already defined for name: ' . $field->getName()
            );
        }

        $index = count($this->fields);

        $this->fieldsNameIndex[$index] = $field->getName();
        $this->fields[] = $field;
    }
818935
protected function addFieldDefaultValue(&$property, Field $field)
    {
        if (!is_null($field->dataValue) && !$field->nullable) {
            $property .= sprintf("->default('%s')", $field->dataValue);
        }

        return $this;
    }
683810
protected function AddInsertFields(&$Fields) {
      $this->DefineSchema();
      if ($this->Schema->FieldExists($this->Name, $this->DateInserted)) {
         if (!isset($Fields[$this->DateInserted]))
            $Fields[$this->DateInserted] = Gdn_Format::ToDateTime();
      }

      $Session = Gdn::Session();
      if ($Session->UserID > 0 && $this->Schema->FieldExists($this->Name, $this->InsertUserID))
         if (!isset($Fields[$this->InsertUserID]))
            $Fields[$this->InsertUserID] = $Session->UserID;

      if ($this->Schema->FieldExists($this->Name, 'InsertIPAddress') && !isset($Fields['InsertIPAddress'])) {
         $Fields['InsertIPAddress'] = Gdn::Request()->IpAddress();
      }
   }
922692
public function insertExistingField(Content $content, Field $field, StorageFieldValue $value)
    {
        $q = $this->dbHandler->createInsertQuery();

        $this->setInsertFieldValues($q, $content, $field, $value);

        $q->set(
            $this->dbHandler->quoteColumn('id'),
            $q->bindValue($field->id, null, \PDO::PARAM_INT)
        );

        $q->prepare()->execute();
    }
1198667
public function beforePropertyModelSave(Property &$property, $insert)
    {
        if ($property->canTranslate()) {
            $property->data_type = Property::DATA_TYPE_INVARIANT_STRING;
        }
        return parent::beforePropertyModelSave($property, $insert);
    }
391790
public static function insertModel($model)
    {
        foreach(AnnotationManager::getPropertiesAnnotations(BeanFactory::getObjectClass($model), RelationBase::class) as $propertyName => $annotations)
        {
            if(null === $model[$propertyName])
            {
                continue;
            }
            $annotation = $annotations[0];
            Insert::parse($model, $propertyName, $annotation);
        }
    }
1117867
public function addInheritedProperty(Property $property)
    {
        $inheritedProperty = clone $property;
        $declaringClass    = $property->getDeclaringClass();

        if ($inheritedProperty instanceof FieldMetadata) {
            if (! $declaringClass->isMappedSuperclass) {
                $inheritedProperty->setTableName($property->getTableName());
            }

            $this->fieldNames[$property->getColumnName()] = $property->getName();
        } elseif ($inheritedProperty instanceof AssociationMetadata) {
            if ($declaringClass->isMappedSuperclass) {
                $inheritedProperty->setSourceEntity($this->className);
            }

            // Need to add inherited fieldNames
            if ($inheritedProperty instanceof ToOneAssociationMetadata && $inheritedProperty->isOwningSide()) {
                foreach ($inheritedProperty->getJoinColumns() as $joinColumn) {
                    /** @var JoinColumnMetadata $joinColumn */
                    $this->fieldNames[$joinColumn->getColumnName()] = $property->getName();
                }
            }
        }

        if (isset($this->declaredProperties[$property->getName()])) {
            throw MappingException::duplicateProperty($this->className, $this->getProperty($property->getName()));
        }

        $this->declaredProperties[$property->getName()] = $inheritedProperty;

        if ($inheritedProperty instanceof VersionFieldMetadata) {
            $this->versionProperty = $inheritedProperty;
        }
    }
530562
public function addFieldCache($field)
    {
        $cache = $this->getMandango()->getCache();

        foreach ($this->getQueryHashes() as $hash) {
            $value = $cache->has($hash) ? $cache->get($hash) : array();
            $value['fields'][$field] = 1;
            $cache->set($hash, $value);
        }
    }
218219
protected function addCustomfield($grid, $field)
    {
        if (!$field instanceof \Antares\Customfield\CustomField) {
            $customfield = with(new \Antares\Customfield\CustomField())->attributes($field);
        } else {
            $customfield = $field;
        }
        $customfield->setModel($grid->row);
        $this->add($customfield);
        if (is_null($grid->rules)) {
            $grid->rules([]);
        }
        $grid->rules(array_merge($grid->rules, $customfield->getRules()));

        $grid->row->saved(function ($row) use ($customfield) {
            $customfield->onSave($row);
        });
    }
25806
private function bindFields()
    {
        foreach ($this->fields as $key => $value) {
            $this->statement->bindValue(':' . $key, $value);
        }
    }
1217549
protected function addPrimaryField(&$property, Field $field = null)
    {
        if (!is_null($field)) {
            $eloquentMethodName = $this->getPrimaryMethodName($field->getEloquentDataMethod());
            $property .= sprintf("%s('%s')", $this->getPropertyBase($eloquentMethodName), $field->name);
            $this->addFieldPropertyClousure($property);
        } else {
            $this->warn('Generating a migration without a primary key.');
        }

        return $this;
    }
1278355
public function addField($field)
    {
        if (!$field instanceof Base) {
            throw new \InvalidArgumentException(
                "No valid object passed to Fieldset::addField(). " .
                "Object should be an instance of \\ValidFormBuilder\\Base.",
                E_ERROR
            );
        }

        $this->__fields->addObject($field);

        // Set parent element hard, overwrite if previously set.
        $field->setMeta("parent", $this, true);

        if ($field->isDynamic() && get_class($field) !== "ValidFormBuilder\\MultiField"
            && get_class($field) !== "ValidFormBuilder\\Area"
        ) {
            $objHidden = new Hidden($field->getId() . "_dynamic", ValidForm::VFORM_INTEGER, array(
                "default" => 0,
                "dynamicCounter" => true
            ));

            $this->__fields->addObject($objHidden);

            $field->setDynamicCounter($objHidden);
        }
    }
1124936
public function addFieldCache($field)
    {
        if ( !$cache = $this->getMongator()->getFieldsCache() ) {
            return null;
        }

        $field = preg_replace('/\.\d+/', '', $field);

        foreach ($this->getQueryHashes() as $hash) {
            $value = $cache->get($hash);
            if (!$value) $value = array();

            if ( !isset($value['fields'][$field]) || $value['fields'][$field] != 1 ) {
                $value['fields'][$field] = 1;
                $cache->set($hash, $value);
            }
        }
    }
504545
public function keyResultsBy($field)
    {
        $results = clone $this->results;
        $this->results = new Collection;
        foreach ($results as $r) {
            $this->addRecord($r, $field);
        }
    }