|
@@ 218-229 (lines=12) @@
|
| 215 |
|
/** |
| 216 |
|
* {@inheritDoc} |
| 217 |
|
*/ |
| 218 |
|
public function contains(PersistentCollection $collection, $element) |
| 219 |
|
{ |
| 220 |
|
if ( ! $this->isValidEntityState($element)) { |
| 221 |
|
return false; |
| 222 |
|
} |
| 223 |
|
|
| 224 |
|
list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
| 225 |
|
|
| 226 |
|
$sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
| 227 |
|
|
| 228 |
|
return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 229 |
|
} |
| 230 |
|
|
| 231 |
|
/** |
| 232 |
|
* {@inheritDoc} |
|
@@ 234-245 (lines=12) @@
|
| 231 |
|
/** |
| 232 |
|
* {@inheritDoc} |
| 233 |
|
*/ |
| 234 |
|
public function removeElement(PersistentCollection $collection, $element) |
| 235 |
|
{ |
| 236 |
|
if ( ! $this->isValidEntityState($element)) { |
| 237 |
|
return false; |
| 238 |
|
} |
| 239 |
|
|
| 240 |
|
list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
| 241 |
|
|
| 242 |
|
$sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
| 243 |
|
|
| 244 |
|
return (bool) $this->conn->executeUpdate($sql, $params, $types); |
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
/** |
| 248 |
|
* {@inheritDoc} |