AppserverIo\Appserver\Core\Api\AppService::findAllByName PHP Method

findAllByName() public method

Returns the applications with the passed name.
public findAllByName ( string $name ) : array
$name string Name of the application to return
return array The applications with the name passed as parameter
    public function findAllByName($name)
    {
        $appNodes = array();
        foreach ($this->findAll() as $appNode) {
            if ($appNode->getName() == $name) {
                $appNodes[$appNode->getPrimaryKey()] = $appNode;
            }
        }
        return $appNodes;
    }

Usage Example

Example #1
0
 /**
  * Test if the findAllByName() method returns the correct number of elements.
  *
  * @return null
  */
 public function testFindAllByName()
 {
     $this->assertCount(2, $this->appService->findAllByName('api'));
 }