/** * Constructor. * @param Comment $comment Instancia con los datos sin modificar. * @param string $commentAutor Nombre del autor. * @param string $commentAuthorEmail Email del autor. * @param int $commentStatus Estado del comentario. 0 = Sin aprobar, 1 = Aprobado * @param string $commentContents Contenido del comentario. */ public function __construct(Comment $comment, $commentAutor, $commentAuthorEmail, $commentStatus, $commentContents) { parent::__construct(Comment::getTableName()); $this->comment = $comment; $this->commentAutor = $commentAutor; $this->commentAuthorEmail = $commentAuthorEmail; $this->commentStatus = $commentStatus; $this->commentContents = $commentContents; }
/** * Metodo que obtiene todos los comentarios segun el identificador del post. * @param int $value * @return Comments */ public static function selectByPostID($value) { $select = self::selectBy(Comment::getTableName(), $value, Comment::POST_ID, \PDO::PARAM_INT); return self::getInstanceData($select); }
/** * Constructor. * @param int $id Identificador. */ public function __construct($id) { parent::__construct($id, Comment::getTableName()); }