Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "snakano/propel-data-cache-behavior",
"description": "A Propel ORM behavior that provide auto data caching to your model.",
"name": "mozart/propel-data-cache-behavior",
"description": "A Propel ORM behavior that provide serialized data caching to your model.",
"keywords": ["propel", "behavior", "cache"],
"license": "MIT",
"authors": [
{
"name": "Shinya Nakano",
"email": "[email protected]"
"name": "Ajoy Sojan"
}
],
"autoload": {
Expand Down
4 changes: 3 additions & 1 deletion src/DataCacheBehaviorPeerBuilderModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public static function cacheFetch(\$key)
\$result = \Domino\CacheStore\Factory::factory('{$backend}')->get(self::TABLE_NAME, \$key);

if (\$result !== null) {
$unserializedResult = unserialize($result);
$result = ($unserializedResult === FALSE) ? $result : $unserializedResult;
if (\$result instanceof ArrayAccess) {
foreach (\$result as \$element) {
if (\$element instanceof {$objectClassname}) {
Expand All @@ -93,7 +95,7 @@ protected function addCacheStore(&$script)
$script .= "
public static function cacheStore(\$key, \$data, \$lifetime)
{
return \Domino\CacheStore\Factory::factory('{$backend}')->set(self::TABLE_NAME, \$key, \$data, \$lifetime);
return \Domino\CacheStore\Factory::factory('{$backend}')->set(self::TABLE_NAME, \$key, serialize(\$data), \$lifetime);
}
";
}
Expand Down