Skip to main content
replaced http://nl3.php.net with https://www.php.net
Source Link

Like Marius said, you don't need a collection for this specific case. If you have to list several order status, then you would use a collection. To make your code more generic (so that you can use it with collections), I would change the interface a little bit:

public function getOneOrderHistoryAction() {
    // extract the parameters from $this->request and pass on
    ...
    return $this->getOrderHistory($oid, $nlm, $eml);
}

public function getOrderHistory($oid, $nlm, $eml) {
    // use the arguments provided
    ...
}    

Also, a small improvement maybe: I think you want strncasecmpstrncasecmp.

Like Marius said, you don't need a collection for this specific case. If you have to list several order status, then you would use a collection. To make your code more generic (so that you can use it with collections), I would change the interface a little bit:

public function getOneOrderHistoryAction() {
    // extract the parameters from $this->request and pass on
    ...
    return $this->getOrderHistory($oid, $nlm, $eml);
}

public function getOrderHistory($oid, $nlm, $eml) {
    // use the arguments provided
    ...
}    

Also, a small improvement maybe: I think you want strncasecmp.

Like Marius said, you don't need a collection for this specific case. If you have to list several order status, then you would use a collection. To make your code more generic (so that you can use it with collections), I would change the interface a little bit:

public function getOneOrderHistoryAction() {
    // extract the parameters from $this->request and pass on
    ...
    return $this->getOrderHistory($oid, $nlm, $eml);
}

public function getOrderHistory($oid, $nlm, $eml) {
    // use the arguments provided
    ...
}    

Also, a small improvement maybe: I think you want strncasecmp.

Source Link

Like Marius said, you don't need a collection for this specific case. If you have to list several order status, then you would use a collection. To make your code more generic (so that you can use it with collections), I would change the interface a little bit:

public function getOneOrderHistoryAction() {
    // extract the parameters from $this->request and pass on
    ...
    return $this->getOrderHistory($oid, $nlm, $eml);
}

public function getOrderHistory($oid, $nlm, $eml) {
    // use the arguments provided
    ...
}    

Also, a small improvement maybe: I think you want strncasecmp.