Fix coding standards

This commit is contained in:
Romain Neutron
2012-01-26 12:32:37 +01:00
parent 692bb01b75
commit 06b8df26b1
312 changed files with 2017 additions and 1651 deletions

View File

@@ -10,7 +10,7 @@
*/
/**
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -20,22 +20,22 @@ class caption_Field_Value
/**
*
* @var int
* @var int
*/
protected $id;
/**
*
* @var string
* @var string
*/
protected $value;
/**
*
* @var databox_field
* @var databox_field
*/
protected $databox_field;
/**
*
* @var record_adapter
* @var record_adapter
*/
protected $record;
@@ -44,7 +44,7 @@ class caption_Field_Value
* @param databox_field $databox_field
* @param record_adapter $record
* @param type $id
* @return \caption_Field_Value
* @return \caption_Field_Value
*/
public function __construct(databox_field $databox_field, record_adapter $record, $id)
{
@@ -116,27 +116,27 @@ class caption_Field_Value
return $this;
}
public function setVocab(\Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface $vocabulary, $vocab_id)
{
$params = array(
':VocabType' => $vocabulary->getType()
, ':VocabularyId' => $vocab_id
);
$sql_up = 'UPDATE metadatas
SET VocabularyType = :VocabType, VocabularyId = :VocabularyId
$sql_up = 'UPDATE metadatas
SET VocabularyType = :VocabType, VocabularyId = :VocabularyId
WHERE id = :meta_id';
$stmt_up = $connbas->prepare($sql_up);
$stmt_up->execute($params);
$stmt_up->closeCursor();
$this->set_value($vocabulary->getValue($vocab_id));
return $this;
}
public function set_value($value)
{
@@ -170,7 +170,7 @@ class caption_Field_Value
}
catch (Exception $e)
{
}
$this->update_cache_value($value);
@@ -232,8 +232,8 @@ class caption_Field_Value
$sbas_id = $databox_field->get_databox()->get_sbas_id();
$connbas = $databox_field->get_connection();
$sql_ins = 'INSERT INTO metadatas
$sql_ins = 'INSERT INTO metadatas
(id, record_id, meta_struct_id, value, VocabularyType, VocabularyId)
VALUES
(null, :record_id, :field, :value, :VocabType, :VocabId)';
@@ -257,4 +257,4 @@ class caption_Field_Value
return $caption_field_value;
}
}
}

View File

@@ -58,8 +58,8 @@ class caption_field //implements cache_cacheableInterface
$connbas = $databox_field->get_connection();
$sql = 'SELECT id FROM metadatas
WHERE record_id = :record_id
$sql = 'SELECT id FROM metadatas
WHERE record_id = :record_id
AND meta_struct_id = :meta_struct_id';
$params = array(
@@ -75,7 +75,7 @@ class caption_field //implements cache_cacheableInterface
if (!$databox_field->is_multi() && count($rs) > 1)
{
/**
* TRIGG CORRECTION;
* TRIGG CORRECTION;
*/
}
@@ -86,10 +86,10 @@ class caption_field //implements cache_cacheableInterface
return $this;
}
/**
*
* @return record_adapter
* @return record_adapter
*/
public function get_record()
{
@@ -221,9 +221,9 @@ class caption_field //implements cache_cacheableInterface
$separator = ' ';
else
$separator = ' ' . $separator . ' ';
$array_values = array();
foreach($values as $value)
{
$array_values[] = $value->getValue();
@@ -264,7 +264,7 @@ class caption_field //implements cache_cacheableInterface
// }
// catch (Exception $e)
// {
//
//
// }
//
// $this->update_cache_value($value);
@@ -380,17 +380,17 @@ class caption_field //implements cache_cacheableInterface
// return $this->value;
// }
// }
public function get_values()
{
return $this->values;
}
public function get_value($meta_id)
{
return $this->values[$meta_id];
}
public function get_serialized_values($custom_separator = false)
{
if ($this->databox_field->is_multi() === true)
@@ -407,10 +407,11 @@ class caption_field //implements cache_cacheableInterface
foreach($this->values as $value)
{
/* @var $value Caption_Field_Value */
return $value->getValue();
}
}
return null;
}
@@ -665,7 +666,7 @@ class caption_field //implements cache_cacheableInterface
}
catch (Exception $e)
{
}
}

View File

@@ -60,6 +60,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
protected function retrieve_fields()
{
if (is_array($this->fields))
return $this->fields;
$fields = array();
@@ -96,7 +97,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
}
catch (Exception $e)
{
}
}
$this->fields = $rec_fields;
@@ -133,6 +134,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
{
$fields = $this->retrieve_fields();
if (isset($this->dces_elements[$label]))
return $fields[$this->dces_elements[$label]];
return null;
}