Return AgeVerification for age_under:xx.

@param int $age

@return null|AgeVerification
506208
public function findAgeUnderVerification($age)
    {
        $ageUnderAttr = sprintf(self::AGE_UNDER_FORMAT, (int) $age);
        return $this->getAgeVerificationByAttribute($ageUnderAttr);
    }
1033402
public function getAge(): int
    {
        if ($age = $this->response->getHeader('Age')) {
            return (int)$age;
        }
        return max(time() - date('U'), 0);
    }
24613
public function getAge()
    {
        if (null !== $age = $this->headers->get('Age')) {
            return (int) $age;
        }

        return max(time() - $this->getDate()->format('U'), 0);
    }
747334
public function getYear()
  {
    if (strlen($this->date) >= 4) {
      $year = substr($this->date, 0, 4);
      $year = str_replace('?', '', $year);

      return ($year ? (int) $year : null);
    }

    return null;
  }
1154658
public function getLastVersionNumber($con = null)
    {
        $v = ChildDealerContactVersionQuery::create()
            ->filterByDealerContact($this)
            ->orderByVersion('desc')
            ->findOne($con);
        if (!$v) {
            return 0;
        }

        return $v->getVersion();
    }
1287162
public function getPermission($role)
    {
        if ($role instanceof RoleInterface || $role instanceof \Symfony\Component\Security\Core\Role\Role) {
            $role = $role->getRole();
        }
        if (isset($this->permissions[$role])) {
            return $this->permissions[$role];
        }

        return null;
    }
321001
public function getControledLifetime($lifetime)
    {
        if (
            null !== $this->_instance_options['min_lifetime']
            && $this->_instance_options['min_lifetime'] > $lifetime
        ) {
            $lifetime = $this->_instance_options['min_lifetime'];
        } elseif (
            null !== $this->_instance_options['max_lifetime']
            && $this->_instance_options['max_lifetime'] < $lifetime
        ) {
            $lifetime = $this->_instance_options['max_lifetime'];
        }

        return $lifetime;
    }
75453
public function getAccessInformation($key = null)
    {
        $info = $this->data['access_information'];

        // Handle old-format (serialized) access information first:
        if (!empty($info) && !in_array(substr($info, 0, 1), array('{', '['))) {
            $data = unserialize($info);
        } else {
            $data = json_decode($info, true);
        }

        if (is_null($key)) {
            $rtn = $data;
        } elseif (isset($data[$key])) {
            $rtn = $data[$key];
        } else {
            $rtn = null;
        }

        return $rtn;
    }
1123190
public function get_restriction($key = 0)
	{
		$restrictions = $this->get_restrictions();
		if (isset($restrictions[$key]))
		{
			return $restrictions[$key];
		}

		return null;
	}
1286264
public function min($key)
	{
		return $this->reduce(function($result, $item) use ($key)
		{
			return is_null($result) || $item->{$key} < $result ? $item->{$key} : $result;
		});
	}
204006
static public function getBirthday($id)
    {
        if (empty($id) || strlen($id) !== 18)
            return null;

        $birthdayStr = substr($id, 6, 8);
        $year = substr($birthdayStr, 0, 4);
        $month = substr($birthdayStr, 4, 2);
        $day = substr($birthdayStr, 6, 2);

        return sprintf('%s-%s-%s', $year, $month, $day);
    }
151651
protected function createAgeVerification(Attribute $attribute)
    {
        $ageCheckArr = explode(static::AGE_DELIMITER, $attribute->getName());
        if (count($ageCheckArr) > 1) {
            $result = $attribute->getValue() === 'true' ? true : false;
            $checkType = $ageCheckArr[0];
            $age = (int) $ageCheckArr[1];

            return new AgeVerification(
                $attribute,
                $checkType,
                $age,
                $result
            );
        }
        return null;
    }
1264895
public function getAge($date = NULL)
    {
        if (is_null($date)) {
            $date = new \MUtil_Date();
        }

        if ($date instanceof \MUtil_Date) {
            // Now calculate age
            $birthDate = $this->getBirthDate();
            if ($birthDate instanceof \Zend_Date) {
				$age = $date->get('Y') - $birthDate->get('Y');
				if ($date->get('MMdd') < $birthDate->get('MMdd')) {
					$age--;
				}
			} else {
				return;
			}
        }

        return $age;
    }
1298559
public function getAge($date = null, $months = false)
    {
        $birthDate = $this->getBirthDay();
        
        if (is_null($date)) {
            $date = new \MUtil_Date();
        }        
        
        if (!($birthDate instanceof \MUtil_Date) || !($date instanceof \MUtil_Date)) {
            return null;
        }
        
        // Now calculate age         
        if ($months) {
            $age  = $date->diffMonths($birthDate);                
            $unit = 'dd';        
        } else {
            $age  = $date->diffYears($birthDate);
            $unit = 'MMdd';
        }
        if ($date->get($unit) < $birthDate->get($unit)) {
            $age--;
        } 

        return $age;
    }
891003
public function age()
    {
        if ($this->wrappedObject->birthdate == null) {
            return;
        }

        $reference = new \DateTime();
        $born = new \DateTime($this->wrappedObject->birthdate);

        if ($this->wrappedObject->birthdate > $reference) {
            throw new InvalidContactAgeException;
        }

        $diff = $reference->diff($born);

        return $diff->y;
    }
176044
public static function getAgeAtEvent(string $age_string): string
    {
        switch (strtoupper($age_string)) {
            case 'CHILD':
                return I18N::translate('Child');
            case 'INFANT':
                return I18N::translate('Infant');
            case 'STILLBORN':
                return I18N::translate('Stillborn');
            default:
                return preg_replace_callback(
                    [
                        '/(\d+)([ymwd])/',
                    ],
                    static function (array $match): string {
                        $num = (int) $match[1];

                        switch ($match[2]) {
                            case 'y':
                                return I18N::plural('%s year', '%s years', $num, I18N::number($num));
                            case 'm':
                                return I18N::plural('%s month', '%s months', $num, I18N::number($num));
                            case 'w':
                                return I18N::plural('%s week', '%s weeks', $num, I18N::number($num));
                            case 'd':
                                return I18N::plural('%s day', '%s days', $num, I18N::number($num));
                            default:
                                throw new LogicException('Should never get here');
                        }
                    },
                    $age_string
                );
        }
    }
563
private function calculateAge(int $age): string
    {
        if ((int) ($age / 365.25) > 0) {
            $result = (int) ($age / 365.25) . 'y';
        } elseif ((int) ($age / 30.4375) > 0) {
            $result = (int) ($age / 30.4375) . 'm';
        } else {
            $result = $age . 'd';
        }

        return FunctionsDate::getAgeAtEvent($result);
    }