Rev 195 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
1
<?php
require_once 'models/Series.php';
class SeriesMapper
extends \PointedEars\PHPX\Db\Mapper
{
private static
$_instance;
protected function __construct
()
{
/* singleton */
}
/**
* @return SeriesMapper
*/
public static
function getInstance
()
{
if (self::$_instance === null)
{
self::$_instance = new self();
}
return self::$_instance;
}
/**
* @param array $series
*/
public function importAll
($series)
{
foreach ($series as $key => &$data)
{
$data['title'] = $key;
$serie = new Series
($data);
// var_dump($data);
var_dump($serie);
// $serie->save();
}
}
/**
* @param array $series
*/
public function getList
($series)
{
$series2 = array();
foreach ($series as $key => &$data)
{
$data['title'] = $key;
$serie = new Series
($data);
$series2[] = $serie;
}
return $series2;
}
}