Return full name of data.

@param Model $model Model using this behavior.
@param int|string|array $id ID of record or array data
for retrieving full name.
@return string|bool Return full name of data,
or False on failure.
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;
	}
439569
public function setHabtmData(Model $model) {
        foreach ($model->hasAndBelongsToMany as $assoc) {
            if (!$assoc['showInForm']) {
                continue;
            }

            $object = Admin::introspectModel($assoc['className']);
            $variable = Inflector::variable(Inflector::pluralize(preg_replace('/(?:_id)$/', '', $assoc['associationForeignKey'])));

            $this->Controller->set($variable, $this->getRecordList($object));
        }
    }
16189
protected function _readMetaData($model)
    {
        $modelName = is_string($model) ? $model : get_class($model);

        if (!isset($this->_metadata[$modelName])) {
            $data = $this->read($modelName);
            if ($data !== false) {
                $this->_metadata[$modelName] = $data;
            } else {
                $modelInstance = is_string($model) ? new $model : $model;

                $data = $this->_di->getShared($modelInstance->getDb(true))->getMetadata($modelInstance->getSource(true));

                $this->_metadata[$modelName] = $data;
                $this->write($modelName, $data);
            }
        }

        return $this->_metadata[$modelName];
    }
1020194
public static function getName($id)
    {
        global $config;
        $req = "
            SELECT nom, prenom
            FROM personne
            WHERE idPersonne = '".mysql_real_escape_string($id)."'
        ";


        $res = $config->connexionBdd->requete($req);

        return mysql_fetch_object($res);
    }
1251511
public static function get(Model $model)
    {
        return Mention::where('model_type', get_class($model))
            ->where('model_id', $model->getKey())
            ->get();
    }
1135699
public function getQueryModel($model=null, $self=true)
    {
        if (!$model) {
            $model = static::getFirstTable();
        }
        
        if ($model && is_string($model)) {
            $model = preg_replace('/^' . $this->getTablePrefix() . '/', '', $model, 1);
            return static::getTableInfo($model);
        } else {
            return $model ? : ($self ? $this : null);
        }
    }
750187
public function getRecordById(Model $model, $id, $deepRelation = true) {
        $model->id = $id;

        $data = $model->find('first', array(
            'conditions' => array($model->alias . '.' . $model->primaryKey => $id),
            'contain' => $this->getDeepRelations($model, $deepRelation)
        ));

        if ($data) {
            $model->set($data);
        }

        return $data;
    }
296994
public function update($id, $model)
    {
        // arguments for private method
        $args = func_get_args();

        // proxy call
        $result = $this->proxy('_update', $args);

        // if($this->shouldUseCache())
        // {
        // 	// Cache::put($this->type . ':' . $result->id, $result, $this->cacheDuration);
        // 	Cache::forget($this->type);
        // }

        return $result;
    }
71590
public function getModelName($model) {
        if (is_object($model)) {
            $model = get_class($model);
        }
        // This guess may work if the extension uses its lowercased name as model group name.
        $result = strtolower(preg_replace(
            '~^[^_]+_([^_]+)_Model_(.+)$~', '$1/$2', $model ));
        // This check is not expensive because the answer should come from Magento's classNameCache
        $checkModel = Mage::getConfig()->getModelClassName($result);
        if ('Mage_' == substr($checkModel, 0, 5) && ! class_exists($result)) {
            // Fallback to full model name.
            $result = $model;
        }
        return $result;
    }
719215
protected function getModelInstanceQuery(Model $model)
    {
        $query = $model->query();

        $this->applyOrderingToModelInstanceQuery($query);
        $this->applyStartAndStopLimitsToQuery($query);

        return $query;
    }
1003690
protected static function getModelKey($id, DynamoDbModel $model)
    {
        if (is_array($id)) {
            $key = [];
            foreach ($id as $name => $value) {
                $specific_key = static::getSpecificDynamoDbKey($model, $name, $value);
                foreach ($specific_key as $keyName => $keyValue) {
                    $key[$keyName] = $keyValue;
                }
            }

            return $key;
        }

        return static::getDynamoDbPrimaryKey($model, $id);
    }
651326
public function show($id)
    {
        $modelName = $this->modelFullName;
        $model = $modelName::find($id);
        if(!$model) throw new NotFoundException('There is no Resource with id = ' . $id . ' !');
        return $model;
    }
1279791
public function getRecordList(Model $model) {
        if ($model->hasMethod('generateTreeList')) {
            return $model->generateTreeList(null, null, null, ' -- ');

        } else if ($model->hasMethod('getList')) {
            return $model->getList();
        }

        return $model->find('list', array(
            'order' => array($model->alias . '.' . $model->displayField => 'ASC')
        ));
    }
285931
public function getGroupName(Model $model) {
		$modelNamePlural = $this->getModelNamePlural($model);
		$groupNameCamel = Inflector::humanize(Inflector::underscore($modelNamePlural));
		$groupName = mb_ucfirst(mb_strtolower($groupNameCamel));

		return $groupName;
	}
276568
public function undelete($model, $id) {
		$runtime = $this->runtime[$model->alias];
		$this->softDelete($model, false);

		$data = array();
		$fields = $this->_normalizeFields($model);
		foreach ($fields as $flag => $date) {
			if (true === $runtime || $flag === $runtime) {
				$data[$flag] = false;
				if ($date) {
					$data[$date] = null;
				}
				if ($flag === $runtime) {
					break;
				}
			}
		}

		$model->create();
		$model->set($model->primaryKey, $id);
		$result = $model->save(array($model->alias => $data), false, array_keys($data));
		$this->softDelete($model, $runtime);
		return $result;
	}
1341879
public function setFullName($id, $fullName)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/fullName', array('value' => $fullName));
    }
310550
protected function getModelTable($model)
    {
        if (!is_object($model)) {
            $model = new $model;
        }

        return DB::getTablePrefix().$model->getTable();
    }