|
@@ 201-212 (lines=12) @@
|
| 198 |
|
/** |
| 199 |
|
* {@inheritDoc} |
| 200 |
|
*/ |
| 201 |
|
public function contains(PersistentCollection $collection, $element) |
| 202 |
|
{ |
| 203 |
|
if ( ! $this->isValidEntityState($element)) { |
| 204 |
|
return false; |
| 205 |
|
} |
| 206 |
|
|
| 207 |
|
list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
| 208 |
|
|
| 209 |
|
$sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
| 210 |
|
|
| 211 |
|
return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
/** |
| 215 |
|
* {@inheritDoc} |
|
@@ 217-228 (lines=12) @@
|
| 214 |
|
/** |
| 215 |
|
* {@inheritDoc} |
| 216 |
|
*/ |
| 217 |
|
public function removeElement(PersistentCollection $collection, $element) |
| 218 |
|
{ |
| 219 |
|
if ( ! $this->isValidEntityState($element)) { |
| 220 |
|
return false; |
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
| 224 |
|
|
| 225 |
|
$sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
| 226 |
|
|
| 227 |
|
return (bool) $this->conn->executeUpdate($sql, $params, $types); |
| 228 |
|
} |
| 229 |
|
|
| 230 |
|
/** |
| 231 |
|
* {@inheritDoc} |