Skip to content

Commit

Permalink
修复 pgsql 模型对字符串数组字段进行了不应该的长度验证
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Oct 19, 2023
1 parent daee04f commit ae2e13a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/Components/pgsql/src/Model/Cli/Model/base-template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ else
*/
public function set<?php echo ucfirst($field['varName']); ?>($<?php echo $field['varName']; ?>)
{
<?php if ($lengthCheck && $length = [
<?php if ($lengthCheck && 0 === $field['ndims'] && $length = [
'character' => $field['length'],
'char' => $field['length'],
'varchar' => $field['length'],
Expand Down
4 changes: 0 additions & 4 deletions src/Components/pgsql/tests/Model/Base/ArrayTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ public function getArr2(): ?array
*/
public function setArr2($arr2)
{
if (\is_string($arr2) && mb_strlen($arr2) > 255)
{
throw new \InvalidArgumentException('The maximum length of $arr2 is 255');
}
$this->arr2 = null === $arr2 ? null : $arr2;

return $this;
Expand Down

0 comments on commit ae2e13a

Please sign in to comment.