Skip to content
Snippets Groups Projects
SprintfPlaceHolderWriter.php 424 B
Newer Older
  • Learn to ignore specific revisions
  • Josh Pollock's avatar
    Josh Pollock committed
    <?php
    
    namespace calderawp\CalderaFormsQuery;
    
    use NilPortugues\Sql\QueryBuilder\Builder\Syntax\PlaceholderWriter;
    
    class SprintfPlaceHolderWriter extends PlaceholderWriter
    {
    
    	/** @inheritdoc */
    	public function add($value)
    	{
    		//@todo type detection
    		$placeholderKey = '%'.$this->counter.'s';
    		$this->placeholders[$placeholderKey] = $this->setValidSqlValue($value);
    
    		++$this->counter;
    
    		return $placeholderKey;
    	}
    
    Josh Pollock's avatar
    Josh Pollock committed
    }