public function setMedia(ChildMedia $v = null)
    {
        if ($v === null) {
            $this->setMediaId(NULL);
        } else {
            $this->setMediaId($v->getId());
        }

        $this->aMedia = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildMedia object, it will not be re-added.
        if ($v !== null) {
            $v->addM2P($this);
        }


        return $this;
    }
public function setMedia(ChildMedia $v = null)
    {
        if ($v === null) {
            $this->setMediaId(NULL);
        } else {
            $this->setMediaId($v->getId());
        }

        $this->aMedia = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildMedia object, it will not be re-added.
        if ($v !== null) {
            $v->addM2P($this);
        }


        return $this;
    }
public function setMedia ( ChildMedia $ v = null ) { if ( $ v === null ) { $ this -> setMediaId ( NULL ) ; } else { $ this -> setMediaId ( $ v -> getId ( ) ) ; } $ this -> aMedia = $ v ; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildMedia object, it will not be re-added. if ( $ v !== null ) { $ v -> addM2P ( $ this ) ; } return $ this ; }
Declares an association between this object and a ChildMedia object.

@param  ChildMedia $v
@return $this|\Attogram\SharedMedia\Orm\M2P The current object (for fluent API support)
@throws PropelException
Declares an association between this object and a ChildMedia object .