src/ORM/UnsavedRelationList.php
public function push($item, $extraFields = null)
    {
        if ((is_object($item) && !$item instanceof $this->dataClass)
            || (!is_object($item) && !is_numeric($item))) {
            throw new InvalidArgumentException(
                "UnsavedRelationList::add() expecting a $this->dataClass object, or ID value",
                E_USER_ERROR
            );
        }
        if (is_object($item) && $item->ID) {
            $item = $item->ID;
        }
        $this->extraFields[] = $extraFields;
        parent::push($item);
    }
public function push($item, $extraFields = null)
    {
        if ((is_object($item) && !$item instanceof $this->dataClass)
            || (!is_object($item) && !is_numeric($item))) {
            throw new InvalidArgumentException(
                "UnsavedRelationList::add() expecting a $this->dataClass object, or ID value",
                E_USER_ERROR
            );
        }
        if (is_object($item) && $item->ID) {
            $item = $item->ID;
        }
        $this->extraFields[] = $extraFields;
        parent::push($item);
    }
public function push ( $ item , $ extraFields = null ) { if ( ( is_object ( $ item ) && ! $ item instanceof $ this -> dataClass ) || ( ! is_object ( $ item ) && ! is_numeric ( $ item ) ) ) { throw new InvalidArgumentException ( "UnsavedRelationList::add() expecting a $this->dataClass object, or ID value" , E_USER_ERROR ) ; } if ( is_object ( $ item ) && $ item -> ID ) { $ item = $ item -> ID ; } $ this -> extraFields [ ] = $ extraFields ; parent :: push ( $ item ) ; }
Pushes an item onto the end of this list.

@param array|object $item
@param array $extraFields
Pushes an item onto the end of this list .