Get by object, label, language

@access public
@param mixed $object
@param string $label
@param Language $language
17734
public static function get_by_object_label_language($object, $label, \Skeleton\I18n\LanguageInterface $language, $auto_create = true) {
		$class_parents = class_parents($object);
		if ($class_parents === false OR count($class_parents) == 0) {
			$class = get_class($object);
		} else {
			$class = array_pop($class_parents);
		}

		if (self::trait_cache_enabled()) {
			try {
                $key = $class . '_' . $object->id . '_' . $label . '_' . $language->name_short;
				$object = self::cache_get($key);
				return $object;
			} catch (\Exception $e) {}
        }

        $db = Database::Get();
		$data = $db->get_row('SELECT * FROM object_text WHERE classname=? AND object_id=? AND label=? AND language_id=?', [ $class, $object->id, $label, $language->id ]);

		if ($data === null) {
		    if (!$auto_create) {
			    throw new \Exception('Object text does not exists');
			} else {
				$requested = new self();
                $requested->object = $object;
				$requested->language_id = $language->id;
				$requested->label = $label;
				$requested->content = '';
				$requested->save();

				if (self::trait_cache_enabled()) {
                    $key = $class . '_' . $object->id . '_' . $label . '_' . $language->name_short;
                    self::cache_set($key, $requested);
                }

                return $requested;
			}
		}

		$object_text = new self();
		$object_text->id = $data['id'];
		$object_text->details = $data;

		if (self::trait_cache_enabled()) {
            $key = $class . '_' . $object->id . '_' . $label . '_' . $language->name_short;
            self::cache_set($key, $object_text);
        }

		return $object_text;
	}
508674
public function label($label = null)
    {
        if (null === $label) {
            return $this->label;
        }
        $this->label = $label;

        return $this;
    }
1057488
private static function initLanguageMap($language = '')
    {
        if ((!$language || $language === self::$language) && count(self::$map) > 0) {
            return;
        }

        // Is a specific map associated with $language?

        if (Arr::key($language, self::$maps) && is_array(self::$maps[$language])) {
            // Move this map to end. This means it will have priority over others
            $langMap = self::$maps[$language];
            unset(self::$maps[$language]);
            self::$maps[$language] = $langMap;
        }

        // Reset static vars
        self::$language = $language;
        self::$map = [];
        self::$chars = '';

        foreach (self::$maps as $map) {
            foreach ((array)$map as $orig => $conv) {
                self::$map[$orig] = $conv;
                self::$chars .= $orig;
            }
        }

        self::$regex = '/[' . self::$chars . ']/u';
    }
1326251
def get_label(self, lang=None):
        
        x = None
        if lang is None:
            for obj in self.graph.objects(self.asNode(), RDFS.label):
                return obj
        for obj in self.graph.objects(self.asNode(), RDFS.label):
            x = obj
            if x.language == lang:
                return x
        return x
589255
public boolean removeSubject(String language) {
        language = determineLanguage(language);
        for (Subject subject : subjects) {
            if (language.equals(subject.language)) {
                return subjects.remove(subject);
            }
        }
        return false;
    }
564836
private static function &getProperty($object, string $property)
  {
    $value = &\Closure::bind(function & () use ($property) {
      return $this->$property;
    }, $object, $object)->__invoke();

    return $value;
  }
714872
public static function unsetLabel($label, $object)
    {
        $result = true;
        $labels = self::getLabels($object);
        if (array_key_exists($label, $labels)) {
            unset($labels[$label]);
            $object->insertToFlexiBee(['id' => $object->getMyKey(), 'stitky@removeAll' => 'true',
                'stitky' => $labels]);
            $result = ($object->lastResponseCode == 201);
        }
        return $result;
    }
593485
private function getValue($object, $property)
    {
        if (is_array($object)) {
            if (!isset($object[$property]) && 0 === strpos($property, 'get')) {
                $property = lcfirst(substr($property, 3));

            }

            return isset($object[$property]) ? $object[$property] : null;
        }

        $getter = 0 === strpos($property, 'get') ? $property : 'get' . ucfirst($property);

        if (method_exists($object, $getter)) {
            return call_user_func([$object, $getter]);
        }

        $reflection = new \ReflectionProperty(get_class($object), $property);
        $reflection->setAccessible(true);

        return $reflection->getValue($object);
    }
3295
public static function object_get($object, $key, $default = null)
    {
        if (\is_null($key) || trim($key) === '') {
            return $object;
        }

        foreach (explode('.', $key) as $segment) {
            if (! \is_object($object) || ! isset($object->{$segment})) {
                return self::value($default);
            }

            $object = $object->{$segment};
        }

        return $object;
    }
868530
public function addLabel($module, $language, $label, $value)
    {
        require_once('modules/ModuleBuilder/parsers/parser.label.php');
        $addLabels = \ParserLabel::addLabels($language, array($label => $value), $module);

        return $addLabels;
    }
995697
public function where( $subject, $predicate, $object ) {
		$this->expressionValidator->validate( $subject,
			ExpressionValidator::VALIDATE_VARIABLE | ExpressionValidator::VALIDATE_PREFIXED_IRI
		);
		$this->expressionValidator->validate( $predicate,
			ExpressionValidator::VALIDATE_VARIABLE | ExpressionValidator::VALIDATE_PATH
		);
		$this->expressionValidator->validate( $object,
			ExpressionValidator::VALIDATE_VARIABLE | ExpressionValidator::VALIDATE_PREFIXED_IRI | ExpressionValidator::VALIDATE_NATIVE
		);

		$this->usageValidator->trackUsedPrefixes(  $subject . ' ' . $predicate . ' ' . $object );
		$this->usageValidator->trackDefinedVariables( $subject  . ' ' . $predicate . ' ' . $object );

		$this->currentSubject = $subject;
		$this->currentPredicate = $predicate;
		$this->conditions[$subject][$predicate][] = $object;

		return $this;
	}
1189046
public function getByLabel($label)
    {
        return isset($this->items[$label]) ? $this->items[$label] : null;
    }
580997
public static function getObjectClass($object)
    {
        if(is_object($object))
        {
            if($object instanceof IBean)
            {
                return get_parent_class($object);
            }
            else
            {
                return get_class($object);
            }
        }
        else
        {
            return (string)$object;
        }
    }
1135340
public function findByLanguage($language)
    {
        $language = Text::toLower($language);
        foreach ($this->getAvailable() as $locale) {
            if ($language == $locale->getLanguage(Text::LOWER)) {
                return $locale;
            }
        }

        return null;
    }
233226
protected function getProperty($object, $key)
    {
        if (isset($object->{$key}) &&
            (
                (is_int($object->{$key}) && $object->{$key} != 0) ||
                (is_string($object->{$key}) && $object->{$key} != '')
            )
        ) {
            return $object->{$key};
        }

        return null;
    }
971724
public function getTags($object)
    {
        $tags = $this->_collectTags($object);
        
        if (is_string($tags)) {
            $tags = array(
                $tags => $tags
            );
        } elseif (!is_array($tags)) {
            return array();
        }
        
        return $tags;
    }
975028
public function getTranslation($language = null)
    {
        if ($language === null) {
            $language = $this->getLanguage();
        }

        if (!isset($this->_models[$language])) {
            $this->_models[$language] = $this->loadTranslation($language);
        }

        return $this->_models[$language];
    }