-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from ticktackk/develop
1.1.0 Alpha 2
- Loading branch information
Showing
24 changed files
with
482 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedMediaGalleryAlbumReaction extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName() : string | ||
{ | ||
return 'media-gallery-album-reaction'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null) : string | ||
{ | ||
return 'Media gallery album reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedMediaGalleryComment extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName() : string | ||
{ | ||
return 'media-gallery-comment'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null) : string | ||
{ | ||
return 'Media gallery comments'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedMediaGalleryCommentReaction extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName() : string | ||
{ | ||
return 'media-gallery-comment-reaction'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null) : string | ||
{ | ||
return 'Media gallery comment reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedMediaGalleryItemReaction extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName(): string | ||
{ | ||
return 'media-gallery-item-reaction'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null): string | ||
{ | ||
return 'Media gallery item reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedProfilePost extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName() : string | ||
{ | ||
return 'profile-post'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null) : string | ||
{ | ||
return 'Profile posts'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedProfilePostComment extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName() : string | ||
{ | ||
return 'profile-post-comment'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null) : string | ||
{ | ||
return 'Profile post comments'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedProfilePostCommentReaction extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName() : string | ||
{ | ||
return 'profile-post-comment-reaction'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null) : string | ||
{ | ||
return 'Profile post comment reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Cli\Command\Seed; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SeedProfilePostReaction extends AbstractSeedCommand | ||
{ | ||
protected function getSeedName() : string | ||
{ | ||
return 'profile-post-reaction'; | ||
} | ||
|
||
protected function getContentTypePlural(InputInterface $input = null) : string | ||
{ | ||
return 'Profile post reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Seed; | ||
|
||
class MediaGalleryAlbumReaction extends AbstractContentReaction | ||
{ | ||
protected function getEntityShortName(): string | ||
{ | ||
return 'XFMG:Album'; | ||
} | ||
|
||
protected function getUserIdColumn(): string | ||
{ | ||
return 'user_id'; | ||
} | ||
|
||
protected function getReactionRelationName(): string | ||
{ | ||
return 'Reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Seed; | ||
|
||
use XF\Mvc\Entity\Entity; | ||
use XFMG\Service\Comment\Creator as CommentCreatorSvc; | ||
|
||
class MediaGalleryComment extends AbstractSeed | ||
{ | ||
use MediaGalleryRandomContentTrait; | ||
|
||
protected function seed(array $params = []): bool | ||
{ | ||
$randomContent = $this->findRandomAlbumOrMediaItemContent(); | ||
if (!$randomContent) | ||
{ | ||
return false; | ||
} | ||
|
||
$faker = $this->faker(); | ||
$commentCreatorSvc = $this->getCommentCreatorSvc($randomContent); | ||
$commentCreatorSvc->setMessage($faker->text); | ||
|
||
if (!$commentCreatorSvc->validate()) | ||
{ | ||
return false; | ||
} | ||
|
||
$commentCreatorSvc->save(); | ||
|
||
return true; | ||
} | ||
|
||
protected function getCommentCreatorSvc(Entity $content) : CommentCreatorSvc | ||
{ | ||
return $this->service('XFMG:Comment\Creator', $content); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Seed; | ||
|
||
class MediaGalleryCommentReaction extends AbstractContentReaction | ||
{ | ||
protected function getEntityShortName(): string | ||
{ | ||
return 'XFMG:Comment'; | ||
} | ||
|
||
protected function getUserIdColumn(): string | ||
{ | ||
return 'user_id'; | ||
} | ||
|
||
protected function getReactionRelationName(): string | ||
{ | ||
return 'Reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace TickTackk\Seeder\Seed; | ||
|
||
class MediaGalleryItemReaction extends AbstractContentReaction | ||
{ | ||
protected function getEntityShortName() : string | ||
{ | ||
return 'XFMG:MediaItem'; | ||
} | ||
protected function getUserIdColumn() : string | ||
{ | ||
return 'user_id'; | ||
} | ||
|
||
protected function getReactionRelationName() : string | ||
{ | ||
return 'Reactions'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.