@@ -31,9 +31,9 @@ public function __construct($factory, $repository)
3131 $ this ->repository = $ repository ;
3232 }
3333
34- public function register ($ author , $ thothWorkId , $ primaryContactId = null )
34+ public function register ($ author , $ seq , $ thothWorkId , $ primaryContactId = null )
3535 {
36- $ thothContribution = $ this ->factory ->createFromAuthor ($ author , $ primaryContactId );
36+ $ thothContribution = $ this ->factory ->createFromAuthor ($ author , $ seq , $ primaryContactId );
3737 $ thothContribution ->setWorkId ($ thothWorkId );
3838
3939 $ filter = empty ($ author ->getOrcid ()) ? $ author ->getFullName (false ) : $ author ->getOrcid ();
@@ -80,18 +80,22 @@ public function registerByPublication($publication)
8080 return $ author ->getId () === $ primaryContactId || !in_array ($ author ->getId (), $ chapterAuthorIds );
8181 });
8282
83+ $ seq = 0 ;
8384 $ thothBookId = $ publication ->getData ('thothBookId ' );
8485 foreach ($ authors as $ author ) {
85- $ this ->register ($ author , $ thothBookId , $ primaryContactId );
86+ $ this ->register ($ author , $ seq , $ thothBookId , $ primaryContactId );
87+ $ seq ++;
8688 }
8789 }
8890
8991 public function registerByChapter ($ chapter )
9092 {
93+ $ seq = 0 ;
9194 $ thothChapterId = $ chapter ->getData ('thothChapterId ' );
9295 $ authors = $ chapter ->getAuthors ()->toArray ();
9396 foreach ($ authors as $ author ) {
94- $ this ->register ($ author , $ thothChapterId );
97+ $ this ->register ($ author , $ seq , $ thothChapterId );
98+ $ seq ++;
9599 }
96100 }
97101}
0 commit comments