public function filterByM2P($m2P, $comparison = null)
    {
        if ($m2P instanceof \Attogram\SharedMedia\Orm\M2P) {
            return $this
                ->addUsingAlias(MediaTableMap::COL_ID, $m2P->getMediaId(), $comparison);
        } elseif ($m2P instanceof ObjectCollection) {
            return $this
                ->useM2PQuery()
                ->filterByPrimaryKeys($m2P->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByM2P() only accepts arguments of type \Attogram\SharedMedia\Orm\M2P or Collection');
        }
    }