public function addAttributeByString($attributeString) { $newImageAttribute = new ImageAttribute(NULL); $newImageAttribute->setImageDataId(parent::getId()); $newImageAttribute->setAttribute($attributeString); $this->addAttribute($newImageAttribute); }
public static function loadImageAttributeListByImageDataId(PDO $dbConnection, $imageDataId) { $preparedStatement = $dbConnection->prepare('SELECT * FROM image_attribute WHERE image_data_id = :imageDataId'); $preparedStatement->bindParam(':imageDataId', $imageDataId); $preparedStatement->execute(); $outputList = array(); $resultRow = NULL; while ($resultRow = $preparedStatement->fetch(PDO::FETCH_ASSOC)) { $imageAttribute = new ImageAttribute($resultRow['id']); $imageAttribute->setImageDataId($imageDataId); $imageAttribute->setAttribute($resultRow['attribute']); $outputList[] = $imageAttribute; } $preparedStatement = NULL; return $outputList; }