1
0
mirror of synced 2024-12-14 07:06:04 +03:00

added fluent pattern to Query\Expr\Base::add* methods

This commit is contained in:
docteurklein 2011-09-27 10:36:32 +02:00
parent 80284a273d
commit b28af2e527

View File

@ -45,12 +45,14 @@ abstract class Base
{
$this->addMultiple($args);
}
public function addMultiple($args = array())
{
foreach ((array) $args as $arg) {
$this->add($arg);
}
return $this;
}
public function add($arg)
@ -67,6 +69,8 @@ abstract class Base
$this->_parts[] = $arg;
}
return $this;
}
public function count()
@ -79,7 +83,7 @@ abstract class Base
if ($this->count() == 1) {
return (string) $this->_parts[0];
}
return $this->_preSeparator . implode($this->_separator, $this->_parts) . $this->_postSeparator;
}
}
}