Returning value for Propel getConnection is PDO (https://github.com/propelorm/Propel/blob/1.6/runtime/lib/Propel.php#L542-L551)
<service id="suggestions.database.handler" class="PDO" lazy="true">
<factory class="Propel" method="getConnection" />
<argument type="constant">SuggesterBundle\Model\SuggestionPeer::DATABASE_NAME</argument>
</service>
PDO prepare is
public function prepare ($statement, array $driver_options = array()) {}
But it generates
/**
* {@inheritDoc}
*/
public function prepare($statement, $options = null) // BUG This should be array by default, and generating "Warning: PDO::prepare() expects parameter 2 to be array, null given"
{
$this->initializer5829d944aa3e0505487367 && $this->initializer5829d944aa3e0505487367->__invoke($this->valueHolder5829d944aa3ab371428905, $this, 'prepare', array('statement' => $statement, 'options' => $options), $this->initializer5829d944aa3e0505487367);
return $this->valueHolder5829d944aa3ab371428905->prepare($statement, $options);
}
Working solution
<service id="suggestions.database.handler" class="PropelPDO" lazy="true">
<factory class="Propel" method="getConnection" />
<argument type="constant">SuggesterBundle\Model\SuggestionPeer::DATABASE_NAME</argument>
</service>
But as I mention earlier getConnection
is returning \PDO
instance
PropelPDO is
public function prepare($sql, $driver_options = array())
and generates
/**
* {@inheritDoc}
*/
public function prepare($sql, $driver_options = array()) // This is correct
{
$this->initializer5829da1913b73243834477 && $this->initializer5829da1913b73243834477->__invoke($this->valueHolder5829da1913b35413254236, $this, 'prepare', array('sql' => $sql, 'driver_options' => $driver_options), $this->initializer5829da1913b73243834477);
return $this->valueHolder5829da1913b35413254236->prepare($sql, $driver_options);
}
See Ocramius/ProxyManager#162