Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 9404bc2

Browse files
committed
Initial commit
1 parent 76244d1 commit 9404bc2

File tree

170 files changed

+16079
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+16079
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### OSX
2+
.DS_Store
3+
.AppleDouble
4+
.LSOverride
5+
6+
## other stuff
7+
/.idea
8+
/vendor
9+
10+
## other files
11+
src/Resources/app/administration/node_modules
12+
13+
src/Resources/app/storefront/dist/
14+
src/Resources/app/storefront/node_modules
15+
16+
src/Resources/public/static/

composer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "magefan/shopware-plugin-blog",
3+
"description": "Blog by Magefan",
4+
"version": "1.0.0",
5+
"type": "shopware-platform-plugin",
6+
"autoload": {
7+
"psr-4": {
8+
"Magefan\\Blog\\": "src/"
9+
}
10+
},
11+
"extra": {
12+
"shopware-plugin-class": "Magefan\\Blog\\MagefanBlog",
13+
"label": {
14+
"de-DE": "Blog by Magefan",
15+
"en-GB": "Blog by Magefan"
16+
},
17+
"description": {
18+
"de-DE": "Magefan Plugin Blog",
19+
"en-GB": "Magefan Plugin Blog"
20+
},
21+
"manufacturerLink": {
22+
"de-DE": "https://magefan.com",
23+
"en-GB": "https://magefan.com"
24+
},
25+
"supportLink": {
26+
"de-DE": "https://magefan.com",
27+
"en-GB": "https://magefan.com"
28+
}
29+
},
30+
"repositories": {
31+
"platform-packages": {
32+
"type": "path",
33+
"url": "../../../src/*"
34+
}
35+
}
36+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Copyright © Magefan (support@magefan.com). All rights reserved.
4+
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magefan\Blog\Core\Content\Blog\Author;
10+
11+
use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
12+
13+
/**
14+
* @method void add(AuthorEntity $entity)
15+
* @method void set(string $key, AuthorEntity $entity)
16+
* @method AuthorEntity[] getIterator()
17+
* @method AuthorEntity[] getElements()
18+
* @method AuthorEntity|null get(string $key)
19+
* @method AuthorEntity|null first()
20+
* @method AuthorEntity|null last()
21+
*/
22+
class AuthorCollection extends EntityCollection
23+
{
24+
/**
25+
* @return string
26+
*/
27+
protected function getExpectedClass(): string
28+
{
29+
return AuthorEntity::class;
30+
}
31+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?php
2+
/**
3+
* Copyright © Magefan (support@magefan.com). All rights reserved.
4+
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magefan\Blog\Core\Content\Blog\Author;
10+
11+
use Magefan\Blog\Core\Content\Blog\Post\PostDefinition;
12+
use Shopware\Core\Content\Media\MediaDefinition;
13+
use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
14+
use Shopware\Core\Framework\DataAbstractionLayer\Field\DateField;
15+
use Shopware\Core\Framework\DataAbstractionLayer\Field\FkField;
16+
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\ApiAware;
17+
use Shopware\Core\Framework\DataAbstractionLayer\Field\IntField;
18+
use Shopware\Core\Framework\DataAbstractionLayer\Field\LongTextField;
19+
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField;
20+
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToOneAssociationField;
21+
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;
22+
use Shopware\Core\Framework\DataAbstractionLayer\Field\BoolField;
23+
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\PrimaryKey;
24+
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required;
25+
use Shopware\Core\Framework\DataAbstractionLayer\Field\IdField;
26+
use Shopware\Core\Framework\DataAbstractionLayer\Field\StringField;
27+
28+
class AuthorDefinition extends EntityDefinition
29+
{
30+
public const ENTITY_NAME = 'magefanblog_author';
31+
32+
/**
33+
* @return string
34+
*/
35+
public function getEntityName(): string
36+
{
37+
return self::ENTITY_NAME;
38+
}
39+
40+
/**
41+
* @return string
42+
*/
43+
public function getEntityClass(): string
44+
{
45+
return AuthorEntity::class;
46+
}
47+
48+
/**
49+
* @return string
50+
*/
51+
public function getCollectionClass(): string
52+
{
53+
return AuthorCollection::class;
54+
}
55+
56+
/**
57+
* @return FieldCollection
58+
*/
59+
protected function defineFields(): FieldCollection
60+
{
61+
return new FieldCollection([
62+
(new IdField('id', 'id'))->addFlags(new Required(), new PrimaryKey()),
63+
(new IdField('admin_user_id', 'adminUserId'))->addFlags(new Required()),
64+
(new BoolField('is_active', 'isActive')),
65+
(new StringField('firstname', 'firstname')),
66+
(new StringField('lastname', 'lastname')),
67+
(new StringField('email', 'email')),
68+
(new StringField('role', 'role')),
69+
(new StringField('facebook_page_url', 'facebookPageUrl')),
70+
(new StringField('twitter_page_url', 'twitterPageUrl')),
71+
(new StringField('instagram_page_url', 'instagramPageUrl')),
72+
(new StringField('googleplus_page_url', 'googleplusPageUrl')),
73+
(new StringField('linkedin_page_url', 'linkedinPageUrl')),
74+
(new StringField('meta_title', 'metaTitle')),
75+
(new StringField('meta_keywords', 'metaKeywords')),
76+
(new StringField('meta_description', 'metaDescription')),
77+
(new StringField('meta_robots', 'metaRobots')),
78+
(new StringField('identifier', 'identifier')),
79+
(new LongTextField('content', 'content')),
80+
(new LongTextField('short_content', 'short_content')),
81+
(new StringField('featured_img', 'featuredImg')),
82+
(new StringField('page_layout', 'pageLayout')),
83+
(new StringField('layout_update_xml', 'layoutUpdateXml')),
84+
(new StringField('custom_theme', 'customTheme')),
85+
(new StringField('custom_layout', 'customLayout')),
86+
(new StringField('custom_layout_update_xml', 'customLayoutUpdateXml')),
87+
(new DateField('custom_theme_from', 'customThemeFrom')),
88+
(new DateField('custom_theme_to', 'customThemeTo')),
89+
(new IntField('posts_per_page', 'postsPerPage')),
90+
(new StringField('posts_list_template', 'postsListTemplate')),
91+
(new IdField('media_id', 'mediaId')),
92+
(new StringField('created_at', 'createdAt')),
93+
(new StringField('updated_at', 'updatedAt')),
94+
new FkField('media_id', 'mediaId', MediaDefinition::class),
95+
new OneToManyAssociationField('authorPosts', PostDefinition::class, 'author_id'),
96+
(new OneToOneAssociationField('media', 'media_id', 'id', MediaDefinition::class, true))->addFlags(new ApiAware()),
97+
]);
98+
}
99+
}

0 commit comments

Comments
 (0)