-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
14054 - INTERNE - Sugarcli - adaptation to the new php version
- Loading branch information
1 parent
d34eb20
commit b165195
Showing
4 changed files
with
58 additions
and
4 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
Binary file not shown.
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
56 changes: 56 additions & 0 deletions
56
src/Console/Command/Relationships/RelationshipsRebuildCommand.php
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,56 @@ | ||
<?php | ||
/** | ||
* SugarCLI | ||
* | ||
* PHP Version 5.3 -> 5.4 | ||
* SugarCRM Versions 6.5 - 7.6 | ||
* | ||
* @author Rémi Sauvat | ||
* @author Emmanuel Dyan | ||
* @copyright 2005-2015 iNet Process | ||
* | ||
* @package inetprocess/sugarcrm | ||
* | ||
* @license Apache License 2.0 | ||
* | ||
* @link http://www.inetprocess.com | ||
*/ | ||
|
||
namespace SugarCli\Console\Command\Relationships; | ||
|
||
use Symfony\Component\Console\Formatter\OutputFormatterStyle; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Inet\SugarCRM\Database\Relationship; | ||
use Inet\SugarCRM\Exception\SugarException; | ||
use SugarCli\Console\ExitCode; | ||
use Inet\SugarCRM\System as SugarSystem; | ||
use Symfony\Component\Console\Helper\ProgressIndicator; | ||
|
||
class RelationshipsRebuildCommand extends AbstractRelationshipsCommand | ||
{ | ||
protected function configure() | ||
{ | ||
parent::configure(); | ||
$this->setName('rels:rebuild') | ||
->setDescription('Rebuild the relationships') | ||
->setHelp(<<<EOH | ||
EOH | ||
)->enableStandardOption('user-id'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$output->writeln('<comment>Rebuild Relationship</comment>: '); | ||
$progress = new ProgressIndicator($output); | ||
|
||
$progress->start('Starting rebuild relationship...'); | ||
$progress->advance(); | ||
|
||
$progress->setMessage('Working...'); | ||
$sugarEP = $this->getService('sugarcrm.entrypoint'); | ||
$sugarSystem = new SugarSystem($sugarEP); | ||
$sugarSystem->rebuildRelationship($input->getOption('user-id')); | ||
$progress->finish('<info>rebuild relationship Done.</info>'); | ||
} | ||
} |