public bool setName ( string $name )
$category = new Category(); $category->setName('Books');
$category = new Category(); $category->setName('Books'); $category->setName('Fiction Books');
use MyPackage\Category; $category = new Category(); $category->setName('Books');In this example, the Category class is part of the "MyPackage" library, which is imported using the "use" statement. The setName method is then used to set the name of the category.