Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documents] Introduce interfaces for editables to replace method_exis…
…ts usages (#10607) * [Documents] Editables - introduce IdRewriterinterface for rewriteIds() - resolves #8908 * [Documents] Editables - introduce EditmodeDataInterface for getDataEditmode() - resolves #8908 * [Documents] Editables - introduce LazyLoadInterface for load() - resolves #8908 * [Documents] Editables - introduce additional interfaces - upgrade notes #8908 * Apply suggestions from code review Co-authored-by: Jacob Dreesen <j.dreesen@neusta.de> * Renamed LazyLoadInterface to LazyLoadingInterface to be consistent in naming * Removed type-hint on \Pimcore\Model\Document\Editable\IdRewriterInterface::rewriteIds() as core-editables implement this interface already and would break custom editables extending core editables implementing this interface Co-authored-by: Jacob Dreesen <j.dreesen@neusta.de> Co-authored-by: Bernhard Rusch <bernhard.rusch@elements.at>
- Loading branch information
1 parent
705751d
commit 065e6da
Showing
20 changed files
with
201 additions
and
162 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
...evelopment_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md
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
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Model\Document\Editable; | ||
|
||
interface EditmodeDataInterface | ||
{ | ||
/** | ||
* Converts the data so it's suitable for the editmode | ||
* | ||
* @return mixed | ||
*/ | ||
public function getDataEditmode() /** : mixed */; | ||
} |
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 | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Model\Document\Editable; | ||
|
||
interface IdRewriterInterface | ||
{ | ||
/** | ||
* Rewrites id from source to target, $idMapping contains | ||
* array( | ||
* "document" => array( | ||
* SOURCE_ID => TARGET_ID, | ||
* SOURCE_ID => TARGET_ID | ||
* ), | ||
* "object" => array(...), | ||
* "asset" => array(...) | ||
* ) | ||
* | ||
* @param array $idMapping | ||
* | ||
* @return void | ||
*/ | ||
public function rewriteIds(/*array*/ $idMapping) /** : void */; | ||
} |
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Model\Document\Editable; | ||
|
||
interface LazyLoadingInterface | ||
{ | ||
/** | ||
* this method is called by Document\Service::loadAllDocumentFields() to load all lazy loading fields | ||
* | ||
* @return void | ||
*/ | ||
public function load() /** : void */; | ||
} |
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
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.