@@ -27,9 +27,9 @@ public function __construct($factory, $repository)
2727 $ this ->repository = $ repository ;
2828 }
2929
30- public function register ($ author , $ thothWorkId , $ primaryContactId = null )
30+ public function register ($ author , $ seq , $ thothWorkId , $ primaryContactId = null )
3131 {
32- $ thothContribution = $ this ->factory ->createFromAuthor ($ author , $ primaryContactId );
32+ $ thothContribution = $ this ->factory ->createFromAuthor ($ author , $ seq , $ primaryContactId );
3333 $ thothContribution ->setWorkId ($ thothWorkId );
3434
3535 $ filter = empty ($ author ->getOrcid ()) ? $ author ->getFullName (false ) : $ author ->getOrcid ();
@@ -64,18 +64,22 @@ public function registerByPublication($publication)
6464 return $ author ->getId () === $ primaryContactId || !in_array ($ author ->getId (), $ chapterAuthorIds );
6565 });
6666
67+ $ seq = 0 ;
6768 $ thothBookId = $ publication ->getData ('thothBookId ' );
6869 foreach ($ authors as $ author ) {
69- $ this ->register ($ author , $ thothBookId , $ primaryContactId );
70+ $ this ->register ($ author , $ seq , $ thothBookId , $ primaryContactId );
71+ $ seq ++;
7072 }
7173 }
7274
7375 public function registerByChapter ($ chapter )
7476 {
77+ $ seq = 0 ;
7578 $ thothChapterId = $ chapter ->getData ('thothChapterId ' );
7679 $ authors = $ chapter ->getAuthors ()->toArray ();
7780 foreach ($ authors as $ author ) {
78- $ this ->register ($ author , $ thothChapterId );
81+ $ this ->register ($ author , $ seq , $ thothChapterId );
82+ $ seq ++;
7983 }
8084 }
8185}
0 commit comments