/** * Check if the entity exists * * @param string[] $args The command arguments * * @return bool True if the entity exists else false */ private function checkEntityName(array $args) : bool { $check = true; if (!isset($args['n'])) { static::fail('You need to specify an entity name with -n parameter' . PHP_EOL); $check = false; } elseif (!in_array($args['n'], DB::getAllEntities())) { static::fail('The entity "' . $args['n'] . '" does not exist' . PHP_EOL); $check = false; } return $check; }