src/snac/data/AbstractData.php
/**
     * Collate SCM by Source
     *
     * Collates all SCM of this object by the source and attaches them into the sources
     * given in the first parameter.  It assumes that the sources array is given with
     * associative IDs equal to the actual source ID, with array[0] reserved for SCM
     * without a source attached.
     *
     * @param  \snac\data\Source[] $sources Associative array of Source objects (with key = source id)
     */
Collate SCM by Source
Collates all SCM of this object by the source and attaches them into the sources
given in the first parameter.  It assumes that the sources array is given with
associative IDs equal to the actual source ID, with array[0] reserved for SCM
without a source attached.

@param  \snac\data\Source[] $sources Associative array of Source objects (with key = source id)
Collate SCM by Source Collates all SCM of this object by the source and attaches them into the sources given in the first parameter . It assumes that the sources array is given with associative IDs equal to the actual source ID with array [ 0 ] reserved for SCM without a source attached . @param \ snac \ data \ Source [] $sources Associative array of Source objects ( with key = source id )
public function collateSCMCitationsBySource(&$sources) {
        if (isset($this->dateList) && $this->dateList !== null) {
            foreach ($this->dateList as &$date) {
                $date->collateSCMCitationsBySource($sources);
            }
        }
        if (isset($this->snacControlMetadata) && $this->snacControlMetadata !== null) {
            foreach ($this->snacControlMetadata as $scm) {
                $newSCM = new \snac\data\SNACControlMetadata($scm->toArray());
                $newSCM->setObject($this->toString());
                if ($scm->getCitation() !== null) {
                    $sources[$scm->getCitation()->getID()]->addSNACControlMetadata($newSCM);
                } else {
                    $sources[0]->addSNACControlMetadata($newSCM);
                }
            }
        }
    }
public function collateSCMCitationsBySource ( & $ sources ) { if ( isset ( $ this -> dateList ) && $ this -> dateList !== null ) { foreach ( $ this -> dateList as & $ date ) { $ date -> collateSCMCitationsBySource ( $ sources ) ; } } if ( isset ( $ this -> snacControlMetadata ) && $ this -> snacControlMetadata !== null ) { foreach ( $ this -> snacControlMetadata as $ scm ) { $ newSCM = new \ snac \ data \ SNACControlMetadata ( $ scm -> toArray ( ) ) ; $ newSCM -> setObject ( $ this -> toString ( ) ) ; if ( $ scm -> getCitation ( ) !== null ) { $ sources [ $ scm -> getCitation ( ) -> getID ( ) ] -> addSNACControlMetadata ( $ newSCM ) ; } else { $ sources [ 0 ] -> addSNACControlMetadata ( $ newSCM ) ; } } } }
Collate SCM by Source
 Collates all SCM of this object by the source and attaches them into the sources
 given in the first parameter.
Collate SCM by Source Collates all SCM of this object by the source and attaches them into the sources given in the first parameter .
//TODO might be useful to have a toString() that would convert this data object into // a display-like short string to display here rather than the full object.