add default parameter in constuctor
This commit is contained in:
parent
6bb22a9a1b
commit
8f141305b7
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
require_once( 'database.php' );
|
||||
class Storage {
|
||||
public function __construct( $IdOrRow ) {
|
||||
public function __construct( $IdOrRow = NULL ) {
|
||||
$row = NULL;
|
||||
if ( isset($IdOrRow) ) {
|
||||
if ( $IdOrRow ) {
|
||||
if ( is_integer( $IdOrRow ) or is_numeric( $IdOrRow ) ) {
|
||||
$row = dbFetchOne( 'SELECT * FROM Storage WHERE Id=?', NULL, array( $IdOrRow ) );
|
||||
if ( ! $row ) {
|
||||
|
|
Loading…
Reference in New Issue