2012-10-25 21:54:16 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once(realpath((dirname(__FILE__)) . "/../AbstractFixtures.php"));
|
|
|
|
|
|
|
|
class BlogFixtures extends AbstractFixtures
|
|
|
|
{
|
2013-07-24 18:17:30 +03:00
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
2012-10-25 21:54:16 +03:00
|
|
|
public static function getOrder()
|
|
|
|
{
|
2013-07-24 18:17:30 +03:00
|
|
|
return 2;
|
2012-10-25 21:54:16 +03:00
|
|
|
}
|
|
|
|
|
2013-07-24 18:17:30 +03:00
|
|
|
/**
|
|
|
|
* Create Blog
|
|
|
|
*/
|
2012-10-25 21:54:16 +03:00
|
|
|
public function load()
|
|
|
|
{
|
2012-11-30 14:37:39 +02:00
|
|
|
$oUserFirst = $this->getReference('user-golfer');
|
2013-07-24 18:17:30 +03:00
|
|
|
$oCategory = $this->getReference('blog-category');
|
2012-10-25 21:54:16 +03:00
|
|
|
|
|
|
|
/* @var $oBlogGadgets ModuleBlog_EntityBlog */
|
|
|
|
$oBlogGadgets = Engine::GetEntity('Blog');
|
2012-11-29 17:18:57 +02:00
|
|
|
$oBlogGadgets->setOwnerId($oUserFirst->getId());
|
2012-10-25 21:54:16 +03:00
|
|
|
$oBlogGadgets->setTitle("Gadgets");
|
|
|
|
$oBlogGadgets->setDescription('Offers latest gadget reviews');
|
|
|
|
$oBlogGadgets->setType('open');
|
|
|
|
$oBlogGadgets->setDateAdd(date("Y-m-d H:i:s")); // @todo freeze
|
|
|
|
$oBlogGadgets->setUrl('gadgets');
|
|
|
|
$oBlogGadgets->setLimitRatingTopic(0);
|
2013-07-24 18:17:30 +03:00
|
|
|
$oBlogGadgets->setCategoryId($oCategory->getCategoryId());
|
2012-10-25 21:54:16 +03:00
|
|
|
|
|
|
|
$this->oEngine->Blog_AddBlog($oBlogGadgets);
|
|
|
|
|
|
|
|
$this->addReference('blog-gadgets', $oBlogGadgets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|