Return plural name of model that uses this behavior.

@param Model $model Model using this behavior.
@param bool $toLowerCase If True, return the model name in lowercase.
@return string Return plural name of model that uses this behavior.
2944
public function getModelNamePlural(Model $model, $toLowerCase = false) {
		$modelName = $this->getModelName($model, $toLowerCase);

		return Inflector::pluralize($modelName);
	}
122879
protected function _lowerCaseTableAndViewNames(&$dump) {
        $configDir      = APPLICATION_PATH."/modules/default/Model/config/";
        $extension      = 'json';
        $patterns       = array();
        $replacements   = array();

        $hardcodedTables = array('AuthFacebook', 'AuthLocal', 'Video');
        foreach ($hardcodedTables as $hardcodedTable) {
            $patterns[]         = "`{$hardcodedTable}`";
            $replacements[]     = "`" . strtolower($hardcodedTable) ."`";
        }

        $modelConfig = new Garp_Model_Spawn_Config_Model_Set(
            new Garp_Model_Spawn_Config_Storage_File($configDir, $extension),
            new Garp_Model_Spawn_Config_Format_Json
        );
        $modelSet = new Garp_Model_Spawn_ModelSet($modelConfig);


        foreach ($modelSet as $model) {
            $lcModel            = strtolower($model->id);
            $patterns[]         = "`{$model->id}`";
            $replacements[]     = "`{$lcModel}`";

            $relations = $model->relations->getRelations();

            foreach ($relations as $relation) {
                if ($relation->type === 'hasAndBelongsToMany') {
                    $bindingModel   = $relation->getBindingModel();
                    $bindingName    = '_' . $bindingModel->id;
                    $lcRelation     = strtolower($bindingName);
                    $patterns[]     = "`{$bindingName}`";
                    $replacements[] = "`{$lcRelation}`";
                } else {
                    $lcRelation     = strtolower($relation->name);
                    $patterns[]     = "`{$relation->name}`";
                    $replacements[] = "`{$lcRelation}`";
                }
            }
        }

        $dump = str_replace($patterns, $replacements, $dump);
        return $dump;
    }
769457
protected function _getAliases(Model $Model) {
		$aliases = array_merge(array(
			//$Model->name,
			$Model->alias
				), $this->config[$Model->alias]['aliases']
		);

		foreach ($Model->associations() as $associationType) {
			foreach ($Model->$associationType as $associationKey => $association) {
				if ($association['className'] === $Model->name) {
					$aliases[] = $associationKey;
				}
			}
		}

		return $aliases;
	}
1153082
public function getEntityName($plural = false)
    {
        $entityClassName = $this->getEntityClassName();
        if ($entityClassName !== null) {
            $entityName = ObjectHelper::class_basename($entityClassName);
        } else {
            $entityName = ObjectHelper::class_basename($this);
        }

        if ($plural) {
            return StringHelper::plural($entityName, is_numeric($plural) ? $plural : 2);
        } else {
            return $entityName;
        }
    }
708721
public function extractEntityName($model)
    {
        $classNames = (array) explode('\\', $model);

        $entityName = end($classNames);

        if ($this->entityHasTranslation($entityName)) {
            return __('exception::exceptions.models.'.$entityName);
        }

        return $entityName;
    }
107489
public function getModelName($type = 'plural')
    {
        $property = $type . 'ModelName';
        if ($this->$property == null) {
            $model = $this->getModel();
            $this->$property = $model->getModelName($type);
        }
        return $this->$property;
    }
260001
def get_name_for_model(cls, model):
        
        key = cls.get_model_key(model)
        model_str = cls._get_model_str(model)
        service = cls._registry[key]
        if model_str in service['resources']:
            return '{}.{}'.format(service['name'], service['resources'][model_str]['name'])
        else:
            return service['name']
352026
public function getFullName(Model $model, $id = null) {
		$name = $this->getName($model, $id);
		if (empty($name)) {
			return false;
		}

		$modelName = $this->getModelName($model);
		$result = $modelName . ' \'' . $name . '\'';

		return $result;
	}
445416
protected function getValueFromModel($model)
    {
        if ( ! ($model instanceof Model)) {
            return null;
        }

        return get_class($model)
             . static::CLASS_AND_KEY_SEPARATOR
             . $model->getKey();
    }
771201
public function pluralize()
    {
        if($this->getParameter('upperCaseFirst') == 'true')
            return ucfirst(StringUtils::pluralize($this->getParameter('value')));

        return StringUtils::pluralize($this->getParameter('value'));
    }
932768
public function getText($model = null)
    {
        $text = (is_callable($this->text) && is_object($model)) ? call_user_func($this->text, $model) : $this->text;

        $title = null;
        if (is_callable($this->title) && is_object($model)) {
            $title = call_user_func($this->title, $model);
        } elseif ($this->title !== null) {
            $title = $this->title;
        } else {
            $title = $text;
        }

        if (! $this->hideTitle) {
            $this->setHtmlAttributes([
                'title' => $title,
                'data-toggle' => 'tooltip',
            ]);
        }

        $this->setHtmlAttributes([
            'class' => $this->class,
        ]);

        return $text;
    }
237910
def contains_plural_field(model, fields):
    
    source_model = model
    for orm_path in fields:
        model = source_model
        bits = orm_path.lstrip('+-').split('__')
        for bit in bits[:-1]:
            field = model._meta.get_field(bit)
            if field.many_to_many or field.one_to_many:
                return True
            model = get_model_at_related_field(model, bit)
    return False
1106643
public static function getClassName($object, $toLower = false)
    {
        $className = $object;
        if (is_object($object)) {
            $className = get_class($object);
        }

        $result = $className;
        if (strpos($className, '\\') !== false) {
            $className = explode('\\', $className);
            reset($className);
            $result = end($className);
        }

        if ($toLower) {
            $result = strtolower($result);
        }

        return $result;
    }
494476
protected function getServiceName(): string
    {
        return Inflector::pluralize(Inflector::tableize(substr($this->modelClass, strrpos($this->modelClass, '\\') + 1)));
    }
1212176
public static function snakeCase(string $value, bool $toLowerCase = false, string $separator = '_'): string
    {
        $replace = strtolower(preg_replace(
            ['/\s+/', '/\s/', '/(?|([a-z\d])([A-Z])|([^\^])([A-Z][a-z]))/', '/[-_]+/'],
            [' ', $separator, '$1' . $separator . '$2', $separator],
            trim($value)
        ));
        return $toLowerCase ? strtolower($replace) : $replace;
    }
904698
public static function toUnderScoreCase($name, $toLower = true)
    {
        $result = trim(preg_replace('/[A-Z]/', '_\0', $name), '_');
        if($toLower)
        {
            $result = strtolower($result);
        }
        return $result;
    }
569347
public static function human_readable_name($lowercase = false) {
        $stringid = 'shape_'.self::name();
        if ($lowercase) {
            $stringid .= '_lowercase';
        }
        return get_string($stringid, 'qtype_ddmarker');
    }