File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2539,4 +2539,20 @@ public function prepareInputForClone($input) {
25392539 $ input ['_skip_create_actors ' ] = true ;
25402540 return $ input ;
25412541 }
2542+
2543+ protected static function getTemplateByName (string $ name ): int {
2544+ global $ DB ;
2545+
2546+ $ targetTemplateType = (new static ())->getTemplateItemtypeName ();
2547+ $ targetTemplate = new $ targetTemplateType ();
2548+ $ targetTemplate ->getFromDBByCrit ([
2549+ 'name ' => $ DB ->escape ($ name ),
2550+ ]);
2551+
2552+ if ($ targetTemplate ->isNewItem ()) {
2553+ return 0 ;
2554+ }
2555+
2556+ return $ targetTemplate ->getID ();
2557+ }
25422558}
Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ abstract public static function getTargetItemtypeName(): string;
7979 */
8080 abstract protected function getTaggableFields ();
8181
82- abstract protected function getTemplateItemtypeName ();
83-
8482 const DESTINATION_ENTITY_CURRENT = 1 ;
8583 const DESTINATION_ENTITY_REQUESTER = 2 ;
8684 const DESTINATION_ENTITY_REQUESTER_DYN_FIRST = 3 ;
@@ -573,19 +571,4 @@ public function prepareInputForClone($input) {
573571 return $ input ;
574572 }
575573
576- protected static function getTemplateByName (string $ name ): int {
577- global $ DB ;
578-
579- $ targetTemplateType = (new static ())->getTemplateItemtypeName ();
580- $ targetTemplate = new $ targetTemplateType ();
581- $ targetTemplate ->getFromDBByCrit ([
582- 'name ' => $ DB ->escape ($ name ),
583- ]);
584-
585- if ($ targetTemplate ->isNewItem ()) {
586- return 0 ;
587- }
588-
589- return $ targetTemplate ->getID ();
590- }
591574}
You can’t perform that action at this time.
0 commit comments