[HttpKernel] renamed a method

This commit is contained in:
Fabien Potencier 2012-05-22 12:04:55 +02:00
parent 148372be9e
commit 5ac20ed80b

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\Profiler; namespace Symfony\Component\HttpKernel\Profiler;
/** /**
* Base PDO storage for profiling information in a PDO database. * Base PDO storage for profiling information in a PDO database.
* *
@ -92,7 +91,7 @@ abstract class PdoProfilerStorage implements ProfilerStorageInterface
); );
try { try {
if ($this->tokenDataExists($profile->getToken())) { if ($this->has($profile->getToken())) {
$this->exec($db, 'UPDATE sf_profiler_data SET parent = :parent, data = :data, ip = :ip, method = :method, url = :url, time = :time, created_at = :created_at WHERE token = :token', $args); $this->exec($db, 'UPDATE sf_profiler_data SET parent = :parent, data = :data, ip = :ip, method = :method, url = :url, time = :time, created_at = :created_at WHERE token = :token', $args);
} else { } else {
$this->exec($db, 'INSERT INTO sf_profiler_data (token, parent, data, ip, method, url, time, created_at) VALUES (:token, :parent, :data, :ip, :method, :url, :time, :created_at)', $args); $this->exec($db, 'INSERT INTO sf_profiler_data (token, parent, data, ip, method, url, time, created_at) VALUES (:token, :parent, :data, :ip, :method, :url, :time, :created_at)', $args);
@ -240,10 +239,11 @@ abstract class PdoProfilerStorage implements ProfilerStorageInterface
/** /**
* Returns whether data for the given token already exists in storage. * Returns whether data for the given token already exists in storage.
* *
* @param string $token * @param string $token The profile token
* @return boolean *
* @return Boolean
*/ */
protected function tokenDataExists($token) protected function has($token)
{ {
$db = $this->initDb(); $db = $this->initDb();
$tokenExists = $this->fetch($db, 'SELECT 1 FROM sf_profiler_data WHERE token = :token LIMIT 1', array(':token' => $token)); $tokenExists = $this->fetch($db, 'SELECT 1 FROM sf_profiler_data WHERE token = :token LIMIT 1', array(':token' => $token));
@ -252,4 +252,3 @@ abstract class PdoProfilerStorage implements ProfilerStorageInterface
return !empty($tokenExists); return !empty($tokenExists);
} }
} }