| |

VerySource

 Forgot password?
 Register
Search
View: 1360|Reply: 5

Experts help me see the function of this function

[Copy link]

2

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Asia/Pacific Region

Post time: 2020-1-10 11:40:01
| Show all posts |Read mode
function insert ($ sessionId, $ clientId)
{
$ this-> session_id = $ sessionId;
$ this-> client_id = $ clientId;

$ this-> time = time ();
$ ret = $ this-> _ db-> insertObject ($ this-> _ tbl, $ this);

if (! $ ret) {
$ this-> _ error = strtolower (get_class ($ this)). "::". JText :: _ ('store failed'). "<br />". $ this-> _ db-> stderr ();
return false;
} else {
return true;
}
}

function insertObject ($ table,&$ object, $ keyName = NULL, $ verbose = false) {
return;
}
Does the following insertObject function work?
Reply

Use magic Report

0

Threads

24

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-1-11 17:09:01
| Show all posts
It is useless to write insertObject as it is.
Reply

Use magic Report

2

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Asia/Pacific Region

 Author| Post time: 2020-1-13 19:00:01
| Show all posts
By the way, if the parameters of the new class bring properties of the class?
Such as
class test {
  var $ a;
  var $ b;
 function test1 () {
return;
}

}
$ test = new test (1,2);
Did 1,2 bring properties to the class?
Reply

Use magic Report

0

Threads

24

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-1-14 18:18:01
| Show all posts
Will not.
Reply

Use magic Report

0

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-16 16:54:01
| Show all posts
Write your own constructor
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-30 12:30:01
| Show all posts
There are no parameters in your function, what value do you assign when you call test() in NEW,
If you want to assign a value, change the code
class test{
  function test1($a,$b){
$c=$a+$b;
return $c;
}

}
$test=new test(1,2);
echo $test->$c;
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list