src/Charcoal/Attachment/Object/Join.php 1 location
|
@@ 392-408 (lines=17) @@
|
389 |
|
* @throws InvalidArgumentException If the position is not an integer (or numeric integer string). |
390 |
|
* @return self |
391 |
|
*/ |
392 |
|
public function setPosition($position) |
393 |
|
{ |
394 |
|
if ($position === null) { |
395 |
|
$this->position = null; |
396 |
|
return $this; |
397 |
|
} |
398 |
|
|
399 |
|
if (!is_numeric($position)) { |
400 |
|
throw new InvalidArgumentException( |
401 |
|
'Position must be an integer.' |
402 |
|
); |
403 |
|
} |
404 |
|
|
405 |
|
$this->position = (int)$position; |
406 |
|
|
407 |
|
return $this; |
408 |
|
} |
409 |
|
|
410 |
|
/** |
411 |
|
* Enable/Disable the relationship. |
src/Charcoal/Attachment/Object/Attachment.php 1 location
|
@@ 677-692 (lines=16) @@
|
674 |
|
* @throws InvalidArgumentException If provided argument is not of type 'integer' or 'float'. |
675 |
|
* @return self |
676 |
|
*/ |
677 |
|
public function setFileSize($size) |
678 |
|
{ |
679 |
|
if ($size === null) { |
680 |
|
$this->fileSize = null; |
681 |
|
|
682 |
|
return $this; |
683 |
|
} |
684 |
|
|
685 |
|
if (!is_numeric($size)) { |
686 |
|
throw new InvalidArgumentException('File size must be an integer or a float.'); |
687 |
|
} |
688 |
|
|
689 |
|
$this->fileSize = $size; |
690 |
|
|
691 |
|
return $this; |
692 |
|
} |
693 |
|
|
694 |
|
/** |
695 |
|
* Set file extension. |