contributions/binaries/behaviour/commands/base/createbinaries.cmd.php
Go to the documentation of this file.00001 <?php 00002 Load::commands('generics/create'); 00003 00004 /** 00005 * Create a binary, including binaray data 00006 * 00007 * @author Gerd Riesselmann 00008 * @ingroup Binaries 00009 */ 00010 class CreateBinariesBaseCommand extends CreateCommand { 00011 /** 00012 * Execute this command 00013 */ 00014 protected function do_execute() { 00015 $ret = new Status(); 00016 00017 $ret->merge(parent::do_execute()); 00018 if ($ret->is_ok()) { 00019 $params = array( 00020 'id_binary' => $this->get_result()->id, 00021 'data' => Arr::get_item($this->get_params(), 'data', '') 00022 ); 00023 $cmd = CommandsFactory::create_command('binariesdata', 'create', $params); 00024 $ret->merge($cmd->execute()); 00025 } 00026 00027 return $ret; 00028 } 00029 }