mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Adding some features to load for notifications)
This commit is contained in:
@@ -138,11 +138,15 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
|
||||
|
||||
foreach($persons as $person) {
|
||||
$activityNbr = rand(0,3);
|
||||
$ref = 'activity_'.$person->getFullnameCanonical();
|
||||
|
||||
for($i = 0; $i < $activityNbr; $i ++) {
|
||||
print "Creating an activity type for : ".$person."\n";
|
||||
print "Creating an activity type for : ".$person." (ref: ".$ref.") \n";
|
||||
$activity = $this->newRandomActivity($person);
|
||||
$manager->persist($activity);
|
||||
}
|
||||
|
||||
$this->setReference($ref, $activity);
|
||||
}
|
||||
$manager->flush();
|
||||
}
|
||||
|
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\MainBundle\DataFixtures\ORM\LoadAbstractNotificationsTrait;
|
||||
|
||||
/**
|
||||
* Load notififications into database
|
||||
*/
|
||||
class LoadActivityNotifications extends AbstractFixture implements OrderedFixtureInterface
|
||||
{
|
||||
use LoadAbstractNotificationsTrait;
|
||||
|
||||
public function getOrder() {
|
||||
return 16500;
|
||||
}
|
||||
|
||||
public $notifs = [
|
||||
[
|
||||
'message' => 'Hello !',
|
||||
'entityClass' => Activity::class,
|
||||
'entityRef' => 'activity_gerard depardieu',
|
||||
'sender' => 'center a_social',
|
||||
'addressees' => [
|
||||
'center a_administrative',
|
||||
'center a_direction',
|
||||
'multi_center'
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user