Returns the Meta object using given type and key from data object.

@param \cmsgears\core\common\models\base\ActiveRecord $model
@param string $type
@param string $key
@param boolean $assoc
@return boolean|\cmsgears\core\common\models\forms\Meta
185512
public function getDataCustomMeta( $model, $type, $key, $assoc = false ) {

		$object	= $model->generateDataObjectFromJson( $assoc );
		$meta	= new Meta();

		if( isset( $object->$type ) && isset( $object->$type->$key ) ) {

			$meta->key		= $key;
			$meta->value	= $object->$type->$key;

			return $meta;
		}

		return false;
	}
559423
public function get(ActiveRecord $model)
    {
        $key = $model::className() . '-' . $model->getPrimaryKey();
        return ArrayHelper::getValue($this->_storage, $key);
    }
733221
private function getManyToManyStatement(array $assoc, $sourceEntity, $offset = null, $limit = null)
    {
        $this->switchPersisterContext($offset, $limit);

        $sourceClass    = $this->em->getClassMetadata($assoc['sourceEntity']);
        $class          = $sourceClass;
        $association    = $assoc;
        $criteria       = array();
        $parameters     = array();

        if ( ! $assoc['isOwningSide']) {
            $class       = $this->em->getClassMetadata($assoc['targetEntity']);
            $association = $class->associationMappings[$assoc['mappedBy']];
        }

        $joinColumns = $assoc['isOwningSide']
            ? $association['joinTable']['joinColumns']
            : $association['joinTable']['inverseJoinColumns'];

        $quotedJoinTable = $this->quoteStrategy->getJoinTableName($association, $class, $this->platform);

        foreach ($joinColumns as $joinColumn) {

            $sourceKeyColumn    = $joinColumn['referencedColumnName'];
            $quotedKeyColumn    = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);

            switch (true) {
                case $sourceClass->containsForeignIdentifier:
                    $field = $sourceClass->getFieldForColumn($sourceKeyColumn);
                    $value = $sourceClass->reflFields[$field]->getValue($sourceEntity);

                    if (isset($sourceClass->associationMappings[$field])) {
                        $value = $this->em->getUnitOfWork()->getEntityIdentifier($value);
                        $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]];
                    }

                    break;

                case isset($sourceClass->fieldNames[$sourceKeyColumn]):
                    $field = $sourceClass->fieldNames[$sourceKeyColumn];
                    $value = $sourceClass->reflFields[$field]->getValue($sourceEntity);

                    break;

                default:
                    throw MappingException::joinColumnMustPointToMappedField(
                        $sourceClass->name, $sourceKeyColumn
                    );
            }

            $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value;
            $parameters[] = array(
                'value' => $value,
                'field' => $field,
                'class' => $sourceClass,
            );
        }

        $sql = $this->getSelectSQL($criteria, $assoc, null, $limit, $offset);
        list($params, $types) = $this->expandToManyParameters($parameters);

        return $this->conn->executeQuery($sql, $params, $types);
    }
775793
protected static function getHasManyRelationField($model, $relation, $activeRelation)
    {
        $widgetOptions = self::getRelationWidgetOptions($model, $relation, $activeRelation, true);
        return static::getRelationWidget($model, $relation, $activeRelation, $widgetOptions);
    }
94428
protected function _containForeignModels($query, $assoc = null) {
		if (
			(isset($query['contain']) && empty($query['contain']))
			|| (isset($this->contain) && empty($this->contain))
		) {
			return $query;
		}

		if (!isset($query['contain'])) {
			$query['contain'] = array();
		} else if (!is_array($query['contain'])) {
			$query['contain'] = (array) $query['contain'];
		}

		// Add the foreign models.
		foreach (array_keys($this->belongsToForeignModels) as $model) {
			if (!empty($assoc)) {
				$model = "$assoc.$model";
			}
			if (!in_array($model, $query['contain']) && !isset($query['contain'][$model])) {
				$query['contain'][] = $model;
			}
		}

		return $query;
	}
1199564
public function decodeJson($assoc = false){

        foreach(self::$jsonable as $key){

            if(isset($this->{$key}) && Utils::isJson($$this->{$key})){
                $this->{$key} = json_decode($this->{$key}, $assoc);
            }
        }

        return $this;
    }
8779
public function getCustomFieldObject($postTypeModel, $key)
	{
		$allKeys = $this->getValidationsKeys($postTypeModel);

		if(array_key_exists($key, $allKeys)){
			return $allKeys[$key];
		}

		return false;
	}
991294
public function find($typeKey, $identifier)
    {
        if (true === $this->cache->has($typeKey, $identifier)) {
            return $this->cache->get($typeKey, $identifier);
        }
        $record = $this->retrieveRecord($typeKey, $identifier);
        return $this->loadModel($typeKey, $record);
    }
248298
public function get_meta( $key ) {
		$metadata = $this->get_metadata();

		if ( ! array_key_exists( $key, $metadata ) ) {
			return;
		}

		return $metadata[ $key ];
	}
876003
public function getJsonResponse($assoc = true)
    {
        //argument 1 must be a boolean
        Argument::i()->test(1, 'bool');

        $this->meta['response'] = $this->getResponse();
        return json_decode($this->meta['response'], $assoc);
    }
109233
public function get($_, $assoc_args)
    {
        $this->init_args(func_get_args());
        list($key) = $_;

        $env = $this->get_env_for_read_or_fail();

        if (is_null($value = $env->get($key))) {
            WP_CLI::error("Key '$key' not found.");
        }

        WP_CLI::line($value);
    }
1229563
def meta_get(self, key, metafield, default=None):
        '''  '''
        return self._meta.get(key, {}).get(metafield, default)
317560
public function getMessage($type = null, $key = 'messages')
    {
        if (isset($type)) {
            $key .= ".$type";
        }

        $message = $this->get($key, array());
        $this->delete($key);
        return $message;
    }
785362
private function getTypes($field, $value, ClassMetadata $class)
    {
        $types = array();

        switch (true) {
            case (isset($class->fieldMappings[$field])):
                $types = array_merge($types, PersisterHelper::getTypeOfField($field, $class, $this->em));
                break;

            case (isset($class->associationMappings[$field])):
                $assoc = $class->associationMappings[$field];
                $class = $this->em->getClassMetadata($assoc['targetEntity']);

                if (! $assoc['isOwningSide']) {
                    $assoc = $class->associationMappings[$assoc['mappedBy']];
                    $class = $this->em->getClassMetadata($assoc['targetEntity']);
                }

                $columns = $assoc['type'] === ClassMetadata::MANY_TO_MANY
                    ? $assoc['relationToTargetKeyColumns']
                    : $assoc['sourceToTargetKeyColumns'];

                foreach ($columns as $column){
                    $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em);
                }
                break;

            default:
                $types[] = null;
                break;
        }

        if (is_array($value)) {
            return array_map(
                function ($type) {
                    return Type::getType($type)->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
                },
                $types
            );
        }

        return $types;
    }
816480
private function doLoadMetadata($type)
    {
        if (null !== $meta = $this->getFromMemory($type)) {
            $this->dispatchMetadataEvent(Events::onMetadataCacheLoad, $meta);
            // Found in memory.
            return $meta;
        }

        if (null !== $meta = $this->getFromCache($type)) {
            // Found in cache.
            $this->dispatchMetadataEvent(Events::onMetadataCacheLoad, $meta);
            $this->setToMemory($meta);
            return $meta;
        }
        return null;
    }
540308
public static function process(ActiveRecord $model, $type)
    {
        $value = self::value($type);

        if (isset($model['votes'])) {
            $model['votes'] += $value;

            $vote = new self([
                'entity_id' => $model['id'],
                'vote' => $value,
                'entity' => self::modelEntityType($model)
            ]);

            if ($vote->save() && $model->save()) {
                return $model;
            }
        }

        return false;
    }
41976
public function get(string $type = '', string $module = '', $key = null) {
		$result = $this->data;
		if (!empty($type)) {
			$result = $result[$type] ?? null;
			if (!isset($result)) return $result;
			if (!empty($module)) {
				$result = $result[$module] ?? null;
				if (!isset($result)) return $result;
				if (!empty($key)) {
					$result = $result[$key] ?? null;
					if (!isset($result)) return $result;
				} else if (!empty($result['datasource'])) {
					// acl is skipped intentionally
					return \Factory::model($result['datasource'], true)->get(['skip_acl' => true]);
				}
			}
		}
		return $result;
	}