Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00016 final class HstoreExpression extends StaticFactory
00017 {
00018 const CONTAIN = '?';
00019 const GET_VALUE = '->';
00020 const LEFT_CONTAIN = '@>';
00021 const CONCAT = '||';
00022
00026 public static function containKey($field, $key)
00027 {
00028 return new BinaryExpression($field, $key, self::CONTAIN);
00029 }
00030
00034 public static function getValueByKey($field, $key)
00035 {
00036 return new BinaryExpression($field, $key, self::GET_VALUE);
00037 }
00038
00042 public static function containValue($field, $key, $value)
00043 {
00044 return new BinaryExpression($field, "{$key}=>{$value}", self::LEFT_CONTAIN);
00045 }
00046
00050 public static function concat($field, $value)
00051 {
00052 return new BinaryExpression($field, $value, self::CONCAT);
00053 }
00054
00058 public static function containHstore($field, Hstore $hstore)
00059 {
00060 return new BinaryExpression($field, $hstore->toString(), self::LEFT_CONTAIN);
00061 }
00062
00063 public static function containValueList($field, array $list)
00064 {
00065 return
00066 self::containHstore(
00067 $field,
00068 Hstore::make($list)
00069 );
00070 }
00071 }
00072 ?>