Generate the attribute handlers.

@param IMetaModel $metaModel The MetaModel.

@return \Generator
330922
public function generate(IMetaModel $metaModel): \Generator
    {
        foreach ($metaModel->getAttributes() as $attribute) {
            if (!$attribute instanceof ITranslated) {
                continue;
            }

            if ($this->handlerFactories->has($class = \get_class($attribute))) {
                yield $attribute->getColName() => $this->handlerFactories->get($class)->create($attribute);
            }
        }
    }
544066
public function getMetaImageLinkAttributes()
    {
        $attributes = [
            'href' => $this->owner->MetaImageLink,
            'class' => $this->owner->MetaImageLinkClass,
            'title' => $this->owner->MetaTitle
        ];
        
        if ($extra = Config::inst()->get(self::class, 'image_link_attributes')) {
            
            foreach ($extra as $name => $value) {
                
                // Process Attribute Value:
                
                $attributes[$name] = ViewTools::singleton()->processAttribute(
                    $value,
                    $this->owner,
                    $this->owner->Renderer
                );
                
            }
            
        }
        
        return $attributes;
    }
229766
protected function setModelAttributes($model)
    {
        $this->setModelClass(Inflector::getClassNameFromNamespace($model));

        if (!property_exists($model, 'tableName') || is_null($this->tableName)) {
            $this->setTableName(Inflector::tabilize($this->getModelClass()));
        }

        if (!property_exists($model, 'database') || is_null($this->database)) {
            $this->setDatabase($this->queryBuilder()->getDefaultConnection());
        } else {
            $this->setDatabase($this->database);
        }

        if (is_null($this->getDatabase())) {
            throw new \InvalidArgumentException(
                'Please specify database name in your model. '.get_called_class()
            );
        }

        $this->setPrimarykey();
    }
402313
protected function compile(): void
    {
        $metaModel = $this->factory->translateIdToMetaModelName($this->metamodel);

        try {
            $this->Template->editor = $this->editor->editFor($metaModel, 'create');
        } catch (NotEditableException $exception) {
            throw new AccessDeniedException($exception->getMessage());
        } catch (NotCreatableException $exception) {
            throw new AccessDeniedException($exception->getMessage());
        }
    }
1340552
public function metas()
    {
        $model = new \Kodeine\Metable\MetaData();
        $model->setTable($this->getMetaTable());

        return new HasMany($model->newQuery(), $this, $this->getMetaKeyName(), $this->getKeyName());
    }
670162
private function createAttributeNode(PropertyMetadata $metadata, string $attributeName): \DOMAttr
    {
        if ($namespace = (string) $metadata->xmlNamespace) {
            $prefix = $this->lookupPrefix($namespace);
            $node = $this->document->createAttributeNS($namespace, $prefix.':'.$attributeName);
        } else {
            $node = $this->document->createAttribute($attributeName);
        }

        return $node;
    }
1205963
protected function getAllEntities()
    {
        $allMeta = $this
            ->getContainer()
            ->get('doctrine')
            ->getManager()
            ->getMetadataFactory()
            ->getAllMetadata();

        /** @var \Doctrine\ORM\Mapping\ClassMetadata $meta */
        foreach ($allMeta as $meta) {
            if (!$meta->isMappedSuperclass && empty($meta->subClasses)) {
                yield $meta->getName();
            }
        }
    }
978565
public function init(GeneratorDataObject $generator, MetaDataInterface $metadata)
    {
        $generatorParser = GeneratorParserFactory::getInstance($this->context);

        return $generatorParser->init($generator, $metadata);
    }
873402
static <T extends FunctionMeta> T createAttributeFunctionMeta(Class<T> metaClass, String formula, IDataModel model) throws Exception {
        T meta = (T) metaClass.newInstance().parse(formula);
        meta.setDataModelId(model.getDataModelId());
        if (meta.getName() == null) { meta.setName(model.getName()); }

        return meta;
    }
1358113
protected function generateUserAgentMetaTags()
    {
        if (!empty($this->tsSetupSeo['ieCompatibilityMode'])) {
            if (is_numeric($this->tsSetupSeo['ieCompatibilityMode'])) {
                $this->metaTagList['ua.msie.compat'] = array(
                    'tag'        => 'meta',
                    'attributes' => array(
                        'http-equiv' => 'X-UA-Compatible',
                        'content'    => 'IE=EmulateIE' . (int)$this->tsSetupSeo['ieCompatibilityMode'],
                    ),
                );
            } else {
                $this->metaTagList['ua.msie.compat'] = array(
                    'tag'        => 'meta',
                    'attributes' => array(
                        'http-equiv' => 'X-UA-Compatible',
                        'content'    => $this->tsSetupSeo['ieCompatibilityMode'],
                    ),
                );
            }
        }
    }
341827
protected function prepareDataProvider($model, $searchModel)
    {
        if ($this->prepareDataProvider !== null) {
            return call_user_func($this->prepareDataProvider, $this, $model, $searchModel);
        }

        return Action::getDataProvider($this->modelClass, $this->getTablesMap(), $model, $searchModel);
    }
514047
function meta()
    {
        if (!$this->_rMetaInfo)
            $this->_rMetaInfo = new MetaReaderOfPhpResource($this->getRHandler());

        return $this->_rMetaInfo;
    }
1012583
public function updateDataAttributeObj( $model, $meta ) {

		$attributes = $model->getDataMeta( 'attributes' );
		$key		= $meta->key;
		$attributes	= !empty( $attributes ) ? $attributes : new \StdClass();

		$attributes->$key = $meta->value;

		$model->updateDataMeta( 'attributes', $attributes );

		$model->refresh();

		return $model;
	}
13341
protected function generate($model, array $attr = [])
    {
        foreach ($attr as $key => $kind) {
            $value = $this->factory->generate($kind, $model, $this);

            $setter = 'set'.ucfirst(static::camelize($key));

            // check if there is a setter and use it instead
            if (method_exists($model, $setter) && is_callable([$model, $setter])) {
                $model->$setter($value);
            } else {
                $model->$key = $value;
            }
        }
    }
1289923
protected function getAttributeNamesFrom($metaModelName)
    {
        $metaModel = $this->factory->getMetaModel($metaModelName);
        $result    = [];

        if (empty($metaModel)) {
            return $result;
        }

        foreach ($metaModel->getAttributes() as $attribute) {
            $name   = $attribute->getName();
            $column = $attribute->getColName();
            $type   = $attribute->get('type');

            $result[$column] = \sprintf('%s (%s - %s)', $name, $column, $type);
        }

        return $result;
    }
77499
private function generateMethods(ClassMetadata $class)
    {
        $methods           = '';
        $methodNames       = [];
        $reflectionMethods = $class->getReflectionClass()->getMethods(\ReflectionMethod::IS_PUBLIC);
        $skippedMethods    = [
            '__sleep'   => true,
            '__clone'   => true,
            '__wakeup'  => true,
            '__get'     => true,
            '__set'     => true,
            '__isset'   => true,
        ];

        foreach ($reflectionMethods as $method) {
            $name = $method->getName();

            if ($method->isConstructor() ||
                isset($skippedMethods[strtolower($name)]) ||
                isset($methodNames[$name]) ||
                $method->isFinal() ||
                $method->isStatic() ||
                ( ! $method->isPublic())
            ) {
                continue;
            }

            $methodNames[$name] = true;
            $methods           .= "\n    /**\n"
                . "     * {@inheritDoc}\n"
                . "     */\n"
                . '    public function ';

            if ($method->returnsReference()) {
                $methods .= '&';
            }

            $methods .= $name . '(' . $this->buildParametersString($method->getParameters()) . ')';
            $methods .= $this->getMethodReturnType($method);
            $methods .= "\n" . '    {' . "\n";

            if ($this->isShortIdentifierGetter($method, $class)) {
                $identifier = lcfirst(substr($name, 3));
                $fieldType  = $class->getTypeOfField($identifier);
                $cast       = in_array($fieldType, ['integer', 'smallint']) ? '(int) ' : '';

                $methods .= '        if ($this->__isInitialized__ === false) {' . "\n";
                $methods .= '            ';
                $methods .= $this->shouldProxiedMethodReturn($method) ? 'return ' : '';
                $methods .= $cast . ' parent::' . $method->getName() . "();\n";
                $methods .= '        }' . "\n\n";
            }

            $invokeParamsString = implode(', ', $this->getParameterNamesForInvoke($method->getParameters()));
            $callParamsString   = implode(', ', $this->getParameterNamesForParentCall($method->getParameters()));

            $methods .= "\n        \$this->__initializer__ "
                . "&& \$this->__initializer__->__invoke(\$this, " . var_export($name, true)
                . ", [" . $invokeParamsString . "]);"
                . "\n\n        "
                . ($this->shouldProxiedMethodReturn($method) ? 'return ' : '')
                . "parent::" . $name . '(' . $callParamsString . ');'
                . "\n" . '    }' . "\n";
        }

        return $methods;
    }
537583
public function bindAttributes(string $modelClass, iterable $attributes): iterable
    {
        $dbPlatform = $this->getConnection()->getDatabasePlatform();
        $types      = $this->getModelSchemas()->getAttributeTypes($modelClass);

        foreach ($attributes as $column => $value) {
            assert(is_string($column) && $this->getModelSchemas()->hasAttributeType($this->getModelClass(), $column));

            $quotedColumn  = $this->quoteSingleIdentifier($column);
            $type          = $this->getDbalType($types[$column]);
            $pdoValue      = $type->convertToDatabaseValue($value, $dbPlatform);
            $parameterName = $this->createNamedParameter($pdoValue, $type->getBindingType());

            yield $quotedColumn => $parameterName;
        }
    }