| @@ 441-461 (lines=21) @@ | ||
| 438 | } |
|
| 439 | } |
|
| 440 | ||
| 441 | class Helpers |
|
| 442 | { |
|
| 443 | ||
| 444 | /** |
|
| 445 | * Determine if a given string contains a given substring. |
|
| 446 | * |
|
| 447 | * @param string $haystack |
|
| 448 | * @param string|array $needles |
|
| 449 | * @return bool |
|
| 450 | */ |
|
| 451 | public static function contains($haystack, $needles) |
|
| 452 | { |
|
| 453 | foreach ((array) $needles as $needle) { |
|
| 454 | if ($needle != '' && strpos($haystack, $needle) !== false) { |
|
| 455 | return true; |
|
| 456 | } |
|
| 457 | } |
|
| 458 | ||
| 459 | return false; |
|
| 460 | } |
|
| 461 | } |
|
| 462 | ||
| 463 | class User extends Model { |
|
| 464 | ||
| @@ 5-25 (lines=21) @@ | ||
| 2 | ||
| 3 | namespace Pyjac\ORM; |
|
| 4 | ||
| 5 | class Helpers |
|
| 6 | { |
|
| 7 | ||
| 8 | /** |
|
| 9 | * Determine if a given string contains a given substring. |
|
| 10 | * |
|
| 11 | * @param string $haystack |
|
| 12 | * @param string|array $needles |
|
| 13 | * @return bool |
|
| 14 | */ |
|
| 15 | public static function contains($haystack, $needles) |
|
| 16 | { |
|
| 17 | foreach ((array) $needles as $needle) { |
|
| 18 | if ($needle != '' && strpos($haystack, $needle) !== false) { |
|
| 19 | return true; |
|
| 20 | } |
|
| 21 | } |
|
| 22 | ||
| 23 | return false; |
|
| 24 | } |
|
| 25 | } |
|