_quote example

(string) $value$matches)) {
                        $quotedValue = $matches[1];
                    }
                    break;
                case Zend_Db::FLOAT_TYPE: // float or decimal                     $quotedValue = sprintf('%F', $value);
            }

            return $quotedValue;
        }

        return $this->_quote($value);
    }

    /** * Quotes a value and places into a piece of text at a placeholder. * * The placeholder is a question-mark; all placeholders will be replaced * with the quoted value. For example: * * <code> * $text = "WHERE date < ?"; * $date = "2005-01-02"; * $safe = $sql->quoteInto($text, $date); * // $safe = "WHERE date < '2005-01-02'" * </code> * * @param string $text the text with a placeholder * @param mixed $value the value to quote * @param string $type OPTIONAL SQL datatype * @param int $count OPTIONAL count of placeholders to replace * * @return string an SQL-safe quoted value placed into the original text */

    protected function _quote($value)
    {
        if ($value instanceof Zend_Date) {
            $value = $value->toString('yyyy-MM-dd HH:mm:ss');
        }

        return parent::_quote($value);
    }

    /** * Begin a transaction. * Opening a zend connection and a dbalconnection results in a fatal error, so we use the doctrine transaction levels * * @return void */
    protected function _beginTransaction()
    {
        $this->dbalConnection->beginTransaction();
    }
Home | Imprint | This part of the site doesn't use cookies.