Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: magefan/module-blog
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.4.0
Choose a base ref
...
head repository: magefan/module-blog
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 536 changed files with 34,197 additions and 5,963 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Preconditions:**
- Magento Version: [e.g. 2.4.2]
- Module Version: [e.g. 2.9.8]
- PHP Version [e.g. 7.4.0]

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Actual behavior**
A clear and concise description of what actually happened.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
14 changes: 14 additions & 0 deletions Api/AuthorCollectionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/

namespace Magefan\Blog\Api;

interface AuthorCollectionInterface
{

}
19 changes: 19 additions & 0 deletions Api/AuthorInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/
declare(strict_types=1);

namespace Magefan\Blog\Api;

interface AuthorInterface
{
/**
* @param int $storeId
* @return bool
*/
public function isVisibleOnStore(int $storeId): bool;
}
57 changes: 57 additions & 0 deletions Api/AuthorRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/

namespace Magefan\Blog\Api;

/**
* Interface AuthorRepositoryInterface
*/
interface AuthorRepositoryInterface
{
/**
* @return AuthorInterfaceFactory
*/
public function getFactory();

/**
* @param AuthorInterface $author
* @return mixed
*/
public function save(AuthorInterface $author);

/**
* @param $authorId
* @return mixed
*/
public function getById($authorId);

/**
* Retrieve Author matching the specified criteria.
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
* @return \Magento\Framework\Api\SearchResults
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);

/**
* @param AuthorInterface $author
* @return mixed
*/
public function delete(AuthorInterface $author);

/**
* Delete Author by ID.
*
* @param int $authorId
* @return bool true on success
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function deleteById($authorId);
}
14 changes: 14 additions & 0 deletions Api/AuthorResourceModelInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/

namespace Magefan\Blog\Api;

interface AuthorResourceModelInterface
{

}
6 changes: 3 additions & 3 deletions Api/CategoryManagementInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © 2016 Ihor Vansach (ihor@magefan.com). All rights reserved.
* See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/
@@ -11,4 +11,4 @@
interface CategoryManagementInterface extends ManagementInterface
{

}
}
60 changes: 60 additions & 0 deletions Api/CategoryRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/

namespace Magefan\Blog\Api;

use Magefan\Blog\Model\Category;
use Magefan\Blog\Model\CategoryFactory;

/**
* Interface PostRepositoryInterface
*/
interface CategoryRepositoryInterface
{
/**
* @return CategoryFactory
*/
public function getFactory();

/**
* @param Category $category
* @return mixed
*/
public function save(Category $category);

/**
* @param $categoryId
* @return mixed
*/
public function getById($categoryId);

/**
* Retrieve Category matching the specified criteria.
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
* @return \Magento\Framework\Api\SearchResults
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);

/**
* @param Category $category
* @return mixed
*/
public function delete(Category $category);

/**
* Delete Category by ID.
*
* @param int $categoryId
* @return bool true on success
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function deleteById($categoryId);
}
16 changes: 16 additions & 0 deletions Api/CommentManagementInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/

declare(strict_types=1);

namespace Magefan\Blog\Api;

interface CommentManagementInterface extends ManagementInterface
{

}
60 changes: 60 additions & 0 deletions Api/CommentRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/

namespace Magefan\Blog\Api;

use Magefan\Blog\Model\Comment;
use Magefan\Blog\Model\CommentFactory;

/**
* Interface CommentRepositoryInterface
*/
interface CommentRepositoryInterface
{
/**
* @return CommentFactory
*/
public function getFactory();

/**
* @param Comment $comment
* @return mixed
*/
public function save(Comment $comment);

/**
* @param $commentId
* @return mixed
*/
public function getById($commentId);

/**
* Retrieve Comment matching the specified criteria.
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
* @return \Magento\Framework\Api\SearchResults
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);

/**
* @param Comment $comment
* @return mixed
*/
public function delete(Comment $comment);

/**
* Delete Comment by ID.
*
* @param int $commentId
* @return bool true on success
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function deleteById($commentId);
}
52 changes: 42 additions & 10 deletions Api/ManagementInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © 2016 Ihor Vansach (ihor@magefan.com). All rights reserved.
* See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
* Copyright © Magefan (support@magefan.com). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/
@@ -14,27 +14,59 @@ interface ManagementInterface
* Create new item.
*
* @api
* @param string $data.
* @return string.
* @param string $data
* @return string
*/
public function create($data);

/**
* Update item by id.
*
* @api
* @param int $id.
* @param string $data.
* @return string.
* @param int $id
* @param string $data
* @return string
*/
public function update($id, $data);

/**
* Remove item by id.
*
* @api
* @param int $id.
* @return bool.
* @param int $id
* @return bool
*/
public function delete($id);
}

/**
* Get item by id.
*
* @api
* @param int $id
* @param int|null $storeId
* @return bool
*/
public function get($id, $storeId = null);

/**
* Get item by id and store id, only if item published
*
* @api
* @param int $id
* @param int $storeId
* @return bool
*/
public function view($id, $storeId);

/**
* Retrieve list by page type, term, store, etc
*
* @param string $type
* @param string $term
* @param int $storeId
* @param int $page
* @param int $limit
* @return string
*/
public function getList($type, $term, $storeId, $page, $limit);
}
Loading