If the ProjectDescriptor's settings allow internal tags then return the Descriptor, otherwise null to filter it.

@param DescriptorAbstract $value

@return DescriptorAbstract|null
321902
public function filter($value)
    {
        $isInternalAllowed = $this->builder->isVisibilityAllowed(Settings::VISIBILITY_INTERNAL);
        if ($isInternalAllowed) {
            $value->setDescription(preg_replace('/\{@internal\s(.+?)\}\}/', '$1', $value->getDescription()));

            return $value;
        }

        // remove inline @internal tags
        $value->setDescription(preg_replace('/\{@internal\s(.+?)\}\}/', '', $value->getDescription()));

        // if internal elements are not allowed; filter this element
        if ($value->getTags()->get('internal')) {
            return null;
        }

        return $value;
    }
510605
public function getTypeFromValue($value = null)
    {
        $value = ($value == null ? $this->value : $value);
        return array_search($this->value, self::$sourceList);
    }
1348054
protected function getValueTypeDescription($value): string
    {
        if (is_resource($value)) {
            $valueType = get_resource_type($value) . " resource";
        } elseif (is_object($value)) {
            $valueType = get_class($value) . " object";
        } elseif (is_string($value)) {
            $valueType = "string \"{$value}\"";
        } else {
            $valueType = gettype($value);
        }

        return $valueType;
    }
1308420
public function getCodeAttribute($value)
    {
        if ($this->active) {
            return $this->details()->active()->first()->code;
        }
        return null;
    }
1184103
public function getRefId($value)
    {
        $id = $this->getValueId($value);

        return $id ? new RefIdValueObject($id) : null;
    }
1149776
public function marshal($value)
    {
        if ($value === null || $value === '' || is_array($value)) {
            return null;
        }

        return (string)$value;
    }
717986
public function setDescriptionAttribute($value)
    {
        $this->attributes['description'] = ! empty($value) ? json_encode(! is_array($value) ? [app()->getLocale() => $value] : $value) : null;
    }
1355551
public function filter($value)
    {
        $filtered = parent::filter($value);
        return null === $filtered ? false : $filtered;
    }
252131
public function filter($value)
    {
        if ($this->toEncoding === null) {
            return $value;
        }

        if ($this->fromEncoding === null) {
            return mb_convert_encoding($value, $this->toEncoding);
        }

        return mb_convert_encoding($value, $this->toEncoding, $this->fromEncoding);
    }
1206897
public function showTrack($value)
    {
        $empty  = $this->util->getTranslated()->getEmptyDropdownArray();
        if (! $value || in_array($value, $empty)) {
            return null;
        }
        if (!$value instanceof \Gems_Tracker_RespondentTrack) {
            $value = $this->loader->getTracker()->getRespondentTrack($value);
        }

        if (!$value instanceof \Gems_Tracker_RespondentTrack) {
            return null;
        }

        $name = $value->getTrackName();
        /*$startDate = $value->getStartDate();
        if ($startDate) {
            $name .= ' (' . $startDate->toString('dd-MM-yyyy') . ')';
        }*/

        if (! $this->menu instanceof \Gems_Menu) {
            $this->menu = $this->loader->getMenu();
        }

        $menuItem = $this->menu->findAllowedController('track', 'show-track');
        if ($menuItem instanceof \Gems_Menu_SubMenuItem) {
            if (!$this->request) {
                $this->request = \Zend_Controller_Front::getInstance()->getRequest();
            }
            $href = $menuItem->toHRefAttribute([
                'gr2t_id_respondent' => $value->getPatientNumber(),
                'gr2t_id_organization' => $value->getOrganizationId(),
                'gr2t_id_respondent_track' => $value->getRespondentTrackId(),
            ], $this->request);
            if ($href) {
                return \MUtil_Html::create('a', $href, $name);
            }
        }

        return $name;
    }
526705
public static function getType($value)
    {
        if (preg_match(self::REGEXP_TCP, $value)) {
            return self::TYPE_TCP;
        }

        if (preg_match(self::REGEXP_SSL, $value)) {
            return self::TYPE_SSL;
        }

        if (preg_match(self::REGEXP_UNIX, $value)) {
            return self::TYPE_UNIX;
        }

        return null;
    }
417551
public function hasDescriptor($descriptor, $value = null)
    {
        $this->loadDescriptors();

        $exists = array_key_exists($descriptor, $this->descriptors);

        if (false === $exists) {
            return false;
        }

        if (null === $value) {
            return true;
        }

        $descriptorValue = $this->descriptors[$descriptor];

        // normalize
        if ($descriptorValue === 'true') {
            $descriptorValue = true;
        }
        if ($descriptorValue === 'false') {
            $descriptorValue = false;
        }

        if ($value === $descriptorValue) {
            return true;
        }

        return false;
    }
964305
public function coerceLiteral(Node $value)
    {
        if ($value instanceof EnumValue) {
            $key = $value->get('value');
            if (($lookup = $this->getNameLookup()) && isset($lookup[$key])) {
                return $lookup[$key] ? $lookup[$key]->getName() : NULL;
            }
        }

        return NULL;
    }
360741
function prepValueForDB($value) {
		if(!$this->nullifyEmpty && $value === '') {
			return DB::getConn()->prepStringForDB($value);
		} else {
			return parent::prepValueForDB($value);
		}
	}
1195119
protected function filterAndValidateDescriptor($descriptor)
    {
        if (!$descriptor instanceof Filterable) {
            return $descriptor;
        }

        // filter the descriptor; this may result in the descriptor being removed!
        $descriptor = $this->filter($descriptor);
        if (!$descriptor) {
            return null;
        }

        // Validate the descriptor and store any errors
        $descriptor->setErrors($this->validate($descriptor));

        return $descriptor;
	}
383883
public function tag($name = null, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'null')
			->test(2, 'scalar', 'null');
			
		$field = Tag::i();
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		if(!is_null($value)) {
			$field->setValue($value);
		}
		
		return $field;
	}
227251
protected static function getLocalizedDescription($value): ?string
    {
        if (static::isLocalizable())
        {
            $localizedStringKey = static::getLocalizationKey() . '.' . $value;

            if (Lang::has($localizedStringKey))
            {
                return __($localizedStringKey);
            }
        }

        return null;
    }