Skip to content

Commit 810b281

Browse files
committed
Column: added hasOption()
1 parent 1a9fb27 commit 810b281

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/Column.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ public function getOptions()
146146
}
147147

148148

149+
/**
150+
* @return array
151+
*/
152+
public function hasOption($name)
153+
{
154+
return array_key_exists($name, $this->options);
155+
}
156+
157+
149158
/**
150159
* @param bool
151160
* @return self

tests/SqlSchema/Column.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ test(function () {
1717
Assert::same(array(), $column->getParameters());
1818
Assert::null($column->getComment());
1919
Assert::null($column->getDefaultValue());
20+
Assert::false($column->hasOption('UNSIGNED'));
2021
});
2122

2223

@@ -47,4 +48,5 @@ test(function () {
4748
Assert::same(array(11), $column->getParameters());
4849
Assert::same('column comment', $column->getComment());
4950
Assert::same(123, $column->getDefaultValue());
51+
Assert::true($column->hasOption('UNSIGNED'));
5052
});

0 commit comments

Comments
 (0)