Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from dantleech/workspace-node-update
[WIP] Workspace Node Update Command and fixes
- Loading branch information
Showing
18 changed files
with
584 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace PHPCR\Util\Console\Command; | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use PHPCR\Util\Console\Helper\PhpcrCliHelper; | ||
use Symfony\Component\Console\Input\InputOption; | ||
|
||
abstract class BaseCommand extends Command | ||
{ | ||
/** | ||
* @return PHPCR\SessionInterface | ||
*/ | ||
protected function getPhpcrSession() | ||
{ | ||
return $this->getHelper('phpcr')->getSession(); | ||
} | ||
|
||
/** | ||
* @return PHPCR\Util\Console\Helper\PhpcrCliHelper | ||
*/ | ||
protected function getPhpcrCliHelper() | ||
{ | ||
$phpcrCliHelper = new PhpcrCliHelper($this->getPhpcrSession()); | ||
return $phpcrCliHelper; | ||
} | ||
|
||
public function configureNodeManipulationInput() | ||
{ | ||
$this->addOption('set-prop', 'p', | ||
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, | ||
'Set node property on nodes use foo=bar' | ||
); | ||
$this->addOption('remove-prop', 'r', | ||
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, | ||
'Remove property from nodes' | ||
); | ||
$this->addOption('add-mixin', null, | ||
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, | ||
'Add a mixin to the nodes' | ||
); | ||
$this->addOption('remove-mixin', null, | ||
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, | ||
'Remove mixin from the nodes' | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.